{"id":49138249,"url":"https://github.com/motivation-inc/yourgpu","last_synced_at":"2026-04-21T23:05:00.857Z","repository":{"id":348832742,"uuid":"1184634805","full_name":"motivation-inc/yourgpu","owner":"motivation-inc","description":"A modern, simple, and fast graphics API for Rust.","archived":false,"fork":false,"pushed_at":"2026-04-19T17:15:18.000Z","size":216,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-19T18:23:29.659Z","etag":null,"topics":["graphics-api","rust","wgpu"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/yourgpu","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/motivation-inc.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-17T19:26:51.000Z","updated_at":"2026-04-19T17:59:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/motivation-inc/yourgpu","commit_stats":null,"previous_names":["motivation-inc/yourgpu"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/motivation-inc/yourgpu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motivation-inc%2Fyourgpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motivation-inc%2Fyourgpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motivation-inc%2Fyourgpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motivation-inc%2Fyourgpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/motivation-inc","download_url":"https://codeload.github.com/motivation-inc/yourgpu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motivation-inc%2Fyourgpu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32113748,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["graphics-api","rust","wgpu"],"created_at":"2026-04-21T23:04:56.994Z","updated_at":"2026-04-21T23:05:00.848Z","avatar_url":"https://github.com/motivation-inc.png","language":"Rust","readme":"# `yourgpu`\n\nyourgpu is an easy-to-use modern graphics API for Rust. It dramatically simplifies going from code to screen, taking influence from [ModernGL](https://github.com/moderngl/moderngl), whilst using [wgpu](https://wgpu.rs/) as the rendering backend.  \n\n```rust\nuse yourgpu::Context;\n\nfn main() {\n    let mut ctx = Context::new();\n    let buf = ctx.storage_buffer(\n        b\"Hello world!\",\n    );\n    \n    println!(\"Data from GPU: {}\", String::from_utf8_lossy(\u0026ctx.read_buffer(\u0026buf)))\n}\n```\n\n## Features\n- Simple and easy to learn\n- Headless system by default (no render target required)\n- First-class [winit](https://github.com/rust-windowing/winit) support\n- Built around the [WebGPU Shading Language](https://www.w3.org/TR/WGSL/)\n- Compute program and shader support\n- Exposed wgpu types for easy integration with WGPU-dependent libraries\n\n## Using `yourgpu`\n\nEverything starts at a `Context` object.\n\n```rust\nuse yourgpu::Context;\n\nfn main() {\n    let mut ctx = Context::new();\n}\n```\n\n`Context` objects give you access to GPU functions, acting as a baseline for all operations. To create a shader program to run on the GPU, we create a `Program`.\n\n```rust\n// ...\nlet prog = ctx.program(\"// vertex shader\", Some(\"// fragment shader\"), \u0026[]);\n```\n\n`Program` objects allow us to also describe shader binding groups, via a `BindGroupBuilder` object. To create data for the GPU, we create a `Buffer`.\n\n```rust\n// ...\n// A `Buffer` with the vertex type\nlet vbo = ctx.vertex_buffer(\u0026[    \n    0.0,  0.6, 0.0,\n   -0.6, -0.6, 0.0,\n    0.6, -0.6, 0.0,\n]);\n```\n\n`Buffer` objects store a variety of data on the GPU, from color to position data. To describe how the vertex buffer is used, we create a `VertexArray`.\n\n```rust\n// ...\nlet vao = ctx.vertex_array(\n    \u0026vbo,\n    None,\n    VertexLayoutBuilder::new()\n        .attr(0, VertexAttributeFormat::Float32x3) // position\n);\n```\n\n`VertexArray` objects describe how to data of a vertex buffer should be used, where `VertexLayoutBuilder` allows a set of attributes and locations describing types. To render the data to a target, like a window, or texture, we create a `RenderPass`.\n\n```rust\n// ...\n// Example: render to a texture\n// Where `tex` is a `Texture` object\nctx.render_texture(\u0026prog, \u0026tex, None,  |r| {\n    r.clear(0.0, 0.0, 0.0, 1.0); // black background\n    r.draw(\u0026vao); // draw the data\n});\n```\n\nFor the full example, see the file in the [examples folder](https://github.com/motivation-inc/yourgpu/blob/main/examples/01_triangle.rs).\n\n## Free \u0026 Open-Source\n\nyourgpu is 100% free with no drawbacks or limitations. There is no \"premium\" version; you get the latest and greatest, all licensed under the GPL-3.0.\n\nAll source code is public, to anyone. There is no \"hidden mechanism\" included in this repository; every reference and used factor exists completely and fully.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmotivation-inc%2Fyourgpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmotivation-inc%2Fyourgpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmotivation-inc%2Fyourgpu/lists"}