{"id":13818708,"url":"https://github.com/Traverse-Research/hassle-rs","last_synced_at":"2025-05-16T01:31:23.566Z","repository":{"id":39993238,"uuid":"161850677","full_name":"Traverse-Research/hassle-rs","owner":"Traverse-Research","description":"🦀 This crate provides an FFI layer and idiomatic rust wrappers for the new DirectXShaderCompiler library.","archived":false,"fork":false,"pushed_at":"2024-05-28T14:07:20.000Z","size":224,"stargazers_count":56,"open_issues_count":10,"forks_count":17,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-10-13T17:21:45.706Z","etag":null,"topics":["compiler","hlsl","rust","rust-library","shader"],"latest_commit_sha":null,"homepage":"","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/Traverse-Research.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-12-14T23:22:27.000Z","updated_at":"2024-10-12T10:11:36.000Z","dependencies_parsed_at":"2023-02-15T17:31:28.641Z","dependency_job_id":"97b5c17e-3398-47ee-b712-a14f3be983bc","html_url":"https://github.com/Traverse-Research/hassle-rs","commit_stats":{"total_commits":129,"total_committers":11,"mean_commits":"11.727272727272727","dds":0.5193798449612403,"last_synced_commit":"dd0f52261775bb895cbbc3e5ab8b0e131e0d05de"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Traverse-Research%2Fhassle-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Traverse-Research%2Fhassle-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Traverse-Research%2Fhassle-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Traverse-Research%2Fhassle-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Traverse-Research","download_url":"https://codeload.github.com/Traverse-Research/hassle-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225397279,"owners_count":17468029,"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":["compiler","hlsl","rust","rust-library","shader"],"created_at":"2024-08-04T08:00:23.341Z","updated_at":"2024-11-19T17:31:24.874Z","avatar_url":"https://github.com/Traverse-Research.png","language":"Rust","funding_links":[],"categories":["Libraries \u0026 Frameworks:"],"sub_categories":["Graphics"],"readme":"🌤 hassle-rs\n========\n[![Actions Status](https://github.com/Traverse-Research/hassle-rs/workflows/Continuous%20integration/badge.svg)](https://github.com/Traverse-Research/hassle-rs/actions)\n[![Latest version](https://img.shields.io/crates/v/hassle-rs.svg)](https://crates.io/crates/hassle-rs)\n[![Documentation](https://docs.rs/hassle-rs/badge.svg)](https://docs.rs/hassle-rs)\n[![Lines of code](https://tokei.rs/b1/github/Traverse-Research/hassle-rs)](https://github.com/Traverse-Research/hassle-rs)\n![MIT](https://img.shields.io/badge/license-MIT-blue.svg)\n[![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4%20adopted-ff69b4.svg)](../master/CODE_OF_CONDUCT.md)\n\n[![Banner](banner.png)](https://traverseresearch.nl)\n\nThis crate provides an FFI layer and idiomatic rust wrappers for the new [DirectXShaderCompiler](https://github.com/Microsoft/DirectXShaderCompiler) library.\n\n- [Documentation](https://docs.rs/hassle-rs)\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nhassle-rs = \"0.11.0\"\n```\n\nThen acquire `dxcompiler.dll` on Windows or `libdxcompiler.so` on Linux directly from [AppVeyor](https://ci.appveyor.com/project/antiagainst/directxshadercompiler/branch/master/artifacts), or compile it from source according to [the instructions](https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/DxcOnUnix.rst#building-dxc) in the [DirectXShaderCompiler](https://github.com/Microsoft/DirectXShaderCompiler) GitHub repository and make sure it's in the executable environment. See our [support table](##Supported-DXC-versions-on-non-Windows) below for specific compatibility notes on non-Windows OSes.\n\nDxcValidator also requires `dxil.dll` which can be grabbed from any recent DXC release: https://github.com/microsoft/DirectXShaderCompiler/releases/latest\nMore info: https://www.wihlidal.com/blog/pipeline/2018-09-16-dxil-signing-post-compile/\n\n## Supported DXC versions on non-Windows\n\nOutside of Windows (e.g. Unix) the emulated COM API needed its fair share of fixes to match the layout on Windows. This results in repetitive API breakage that is hard to detect from within `hassle-rs`: be sure to math the `hassle-rs` release below to a minimum DXC commit to prevent runtime failures outside of Windows!\n\n| Since `hassle-rs` | DXC release | Git commit |\n|-|-|-|\n| 0.10.0 | [v1.7.2212](https://github.com/microsoft/DirectXShaderCompiler/releases/tag/v1.7.2212) | https://github.com/microsoft/DirectXShaderCompiler/commit/47f31378a9b51894b0465b33ac1d10ce6349a468 |\n| 0.5.1 (if using `intellisense`) | [release-1.6.2012](https://github.com/microsoft/DirectXShaderCompiler/tree/release-1.6.2012) | https://github.com/microsoft/DirectXShaderCompiler/commit/2ade6f84d6b95bfd96eec1d6d15e3aa3b519d180 |\n\nWhen compiling on MacOS with `clang`, or Linux with `gcc`, be sure to have at least https://github.com/microsoft/DirectXShaderCompiler/commit/af14220b45d3ce46e0bad51ce79655e41d07c478 (also included in `release-1.6.2012`).\n\n\u003cdetails\u003e\n\u003csummary\u003eInteresting DXC commits pertaining Unix support\u003c/summary\u003e\n\nThese patches have had an effect on `hassle-rs` compatibility over time:\n\n- [`[Linux] WinAdapter: Remove virtual dtors from IUnknown to fix vtable ABI`](https://github.com/microsoft/DirectXShaderCompiler/commit/47f31378a9b51894b0465b33ac1d10ce6349a468)\n- [`Linux: Implement prefix-counted BSTR allocation in SysAllocStringLen`](https://github.com/microsoft/DirectXShaderCompiler/commit/2ade6f84d6b95bfd96eec1d6d15e3aa3b519d180)\n- [`[linux-port] Support full IID comparison on GCC`](https://github.com/microsoft/DirectXShaderCompiler/commit/af14220b45d3ce46e0bad51ce79655e41d07c478)\n\n\u003c/details\u003e\n\n## Usage examples\n\n### Compile HLSL into SPIR-V\n\n```rust\nlet spirv = compile_hlsl(\n    \"shader_filename.hlsl\",\n    code,\n    \"copyCs\",\n    \"cs_6_5\",\n    \u0026vec![\"-spirv\"],\n    \u0026vec![\n        (\"MY_DEFINE\", Some(\"Value\")),\n        (\"OTHER_DEFINE\", None)\n    ],\n);\n```\n\n### Compile HLSL into DXIL and validate it\n\n```rust\nlet dxil = compile_hlsl(\"test.cs.hlsl\", test_cs, \"main\", \"cs_6_5\", args, \u0026[]).unwrap();\nlet result = validate_dxil(\u0026dxil); // Only a Windows machine in Developer Mode can run non-validated DXIL\n\nif let Some(err) = result.err() {\n    println!(\"validation failed: {}\", err);\n}\n```\n\n## License\n\nLicensed under MIT license ([LICENSE](LICENSE) or http://opensource.org/licenses/MIT)\n\n## Contributions\n\n - Graham Wihlidal\n - Tiago Carvalho\n - Marijn Suijten\n - Tomasz Stachowiak\n - Manon Oomen\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this crate by you, shall be licensed as above, without any additional terms or conditions.\n\nContributions are always welcome; please look at the [issue tracker](https://github.com/Traverse-Research/hassle-rs/issues) to see what known improvements are documented.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTraverse-Research%2Fhassle-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTraverse-Research%2Fhassle-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTraverse-Research%2Fhassle-rs/lists"}