{"id":19141067,"url":"https://github.com/computer-graphics-tools/wgpu-tools","last_synced_at":"2025-09-08T21:32:23.037Z","repository":{"id":246232107,"uuid":"820485951","full_name":"computer-graphics-tools/wgpu-tools","owner":"computer-graphics-tools","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-28T11:29:54.000Z","size":490,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-09T08:13:27.941Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/computer-graphics-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-26T15:02:08.000Z","updated_at":"2024-07-09T15:24:15.000Z","dependencies_parsed_at":"2024-11-09T07:20:31.829Z","dependency_job_id":"41402fbf-15e1-4c01-8926-a756019720df","html_url":"https://github.com/computer-graphics-tools/wgpu-tools","commit_stats":null,"previous_names":["computer-graphics-tools/wgpu-tools"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/computer-graphics-tools/wgpu-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computer-graphics-tools%2Fwgpu-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computer-graphics-tools%2Fwgpu-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computer-graphics-tools%2Fwgpu-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computer-graphics-tools%2Fwgpu-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/computer-graphics-tools","download_url":"https://codeload.github.com/computer-graphics-tools/wgpu-tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/computer-graphics-tools%2Fwgpu-tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274231461,"owners_count":25245625,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T07:20:17.676Z","updated_at":"2025-09-08T21:32:22.658Z","avatar_url":"https://github.com/computer-graphics-tools.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WGPU Tools\n\n\u003cp align=\"left\"\u003e\n    \u003cimg src=\"media/WGPUTools.png\", width=\"160\"\u003e\n\u003c/p\u003e\n\nA Rust library providing utility functions and abstractions for working with [WGPU](https://wgpu.rs), similar to [MetalTools](https://github.com/computer-graphics-tools/metal-tools).\n\n## Features\n\n- Context creation and management\n- Texture handling utilities\n- GPU operation scheduling\n- Error handling\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nwgpu-tools = \"0.0.1\"\n```\n\n## Usage\n\nHere are some examples of how to use wgpu-tools:\n\n### Creating a standalone context\n\n```rust\nuse wgpu_tools::Context;\n\nasync fn create_context() -\u003e Result\u003cContext, wgpu_tools::Error\u003e {\n    Context::default().await\n}\n```\n\n### Creating a context with a surface\n\n```rust\nuse wgpu_tools::Context;\n\nasync fn create_context_with_surface(window: \u0026impl raw_window_handle::HasRawWindowHandle) -\u003e Result\u003c(Context, wgpu::Surface), wgpu_tools::Error\u003e {\n    let instance = wgpu::Instance::new(wgpu::InstanceDescriptor::default());\n    let surface = unsafe { instance.create_surface(window) }?;\n    let context = Context::default_with_surface(instance, Some(\u0026surface)).await?;\n    Ok((context, surface))\n}\n```\n\n### Scheduling GPU operations\n\n```rust\nuse wgpu_tools::Context;\n\nfn schedule_gpu_operations(context: \u0026Context) {\n    context.schedule(|encoder| {\n        // Perform GPU operations using the encoder\n        // For example:\n        let _render_pass = encoder.begin_render_pass(\u0026wgpu::RenderPassDescriptor {\n            label: Some(\"Render Pass\"),\n            color_attachments: \u0026[],\n            depth_stencil_attachment: None,\n        });\n        // Add more GPU commands as needed\n    });\n}\n```\n\n### Loading a texture from an image file\n\n```rust\nuse wgpu_tools::Context;\nuse image::io::Reader as ImageReader;\n\nfn load_texture_from_file(context: \u0026Context, path: \u0026std::path::Path) -\u003e Result\u003cwgpu_tools::Texture, wgpu_tools::Error\u003e {\n    let img = ImageReader::open(path)?.decode()?;\n    context.texture_from_image(\u0026img, \u0026wgpu::TextureFormat::Rgba8UnormSrgb, Some(\"Loaded Texture\"))\n}\n```\n\n## Main Components\n\n### Context\n\nThe `Context` struct provides a convenient wrapper around wgpu's instance, adapter, device, and queue. It offers methods for creating contexts, scheduling GPU operations, and creating textures.\n\n### Texture\n\nThe `Texture` struct encapsulates wgpu texture, view, and sampler objects.\n\n### Error Handling\n\nCustom error types are provided to handle various failure scenarios in wgpu operations.\n\n## License\n\nWGPUTools is licensed under [MIT license](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomputer-graphics-tools%2Fwgpu-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomputer-graphics-tools%2Fwgpu-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomputer-graphics-tools%2Fwgpu-tools/lists"}