{"id":17835698,"url":"https://github.com/rob2309/spirv-layout","last_synced_at":"2025-03-19T16:31:05.231Z","repository":{"id":44780641,"uuid":"440545844","full_name":"Rob2309/spirv-layout","owner":"Rob2309","description":"SPIRV reflection utility for deriving Vulkan DescriptorSetLayouts","archived":false,"fork":false,"pushed_at":"2022-12-30T09:25:34.000Z","size":29,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T19:52:57.477Z","etag":null,"topics":["game-development","glsl","graphics","hlsl","reflection","rust","spirv","vulkan"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/spirv-layout","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/Rob2309.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}},"created_at":"2021-12-21T14:31:57.000Z","updated_at":"2024-07-30T11:48:50.000Z","dependencies_parsed_at":"2023-01-31T11:01:41.179Z","dependency_job_id":null,"html_url":"https://github.com/Rob2309/spirv-layout","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob2309%2Fspirv-layout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob2309%2Fspirv-layout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob2309%2Fspirv-layout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob2309%2Fspirv-layout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rob2309","download_url":"https://codeload.github.com/Rob2309/spirv-layout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244006260,"owners_count":20382441,"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","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":["game-development","glsl","graphics","hlsl","reflection","rust","spirv","vulkan"],"created_at":"2024-10-27T20:24:26.730Z","updated_at":"2025-03-19T16:31:04.962Z","avatar_url":"https://github.com/Rob2309.png","language":"Rust","readme":"# SPIRV-Layout\r\n\r\n[![MIT License](https://img.shields.io/badge/License-MIT-blue?style=for-the-badge)](https://choosealicense.com/licenses/mit/) \r\n[![Continuous integration](https://img.shields.io/github/actions/workflow/status/rob2309/spirv-layout/ci.yaml?style=for-the-badge)](https://github.com/rob2309/spirv-layout/actions) \r\n[![Crates.io](https://img.shields.io/crates/v/spirv-layout?style=for-the-badge)](https://crates.io/crates/spirv-layout)\r\n[![docs.rs](https://img.shields.io/docsrs/spirv-layout?style=for-the-badge)](https://docs.rs/spirv-layout)\r\n\r\nThis library parses SPIRV binaries and retrieves reflection info.\r\nIt is most useful for deriving a Vulkan `DescriptorSetLayout` from a shader module, as well as finding offsets and names of individual fields in the Uniform Buffers of a shader.\r\n\r\nThis crate is used by the [vulkan-engine](https://github.com/michidk/vulkan-engine) project.\r\n\r\n## Usage\r\n\r\n```rust\r\nlet bytes = std::fs::read(PATH).unwrap();\r\nlet words = unsafe { slice::from_raw_parts(bytes.as_ptr() as *const u32, bytes.len() / 4) };\r\nlet module = Module::from_words(words).unwrap();\r\n\r\nprintln!(\"=== UNIFORMS ===\");\r\nfor var in module.get_uniforms() {\r\n    print_var(\u0026module, var);\r\n}\r\n\r\nprintln!(\"=== PUSH CONSTANTS ===\");\r\nfor var in module.get_push_constants() {\r\n    print_var(\u0026module, var);\r\n}\r\n```\r\n\r\nFor an actual usage example, see [`examples/reflect-shader`](examples/reflect-shader/main.rs)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob2309%2Fspirv-layout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frob2309%2Fspirv-layout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob2309%2Fspirv-layout/lists"}