forked from gfx-rs/wgpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
453: Added Static Lifetime to Statically Loaded SPIR-V Modules r=kvark a=Andful The commit enables `include_spirv!` to return a `ShaderModuleSource<'static>`. This allows `ShaderModuleSource` to outlive the context in which `include_spirv!` was called in. An example where this implementation would work but the previews would not is the following. ```rust fn get_vertex_module<'a>() -> wgpu::ShaderModuleSource<'a> { wgpu::include_spirv!("shader.vert.spv") } let vs_module = device.create_shader_module(get_vertex_module()); ``` Also it makes logical sense for a statically loaded module to have a static lifetime. The only downside that this change might bring is the redundant presence of the binary string (the non aligned binary string and the aligned binary string) but from the produced assembly I could only find one copy of the binary string so I don't think this is the case. Co-authored-by: Andrea Nardi <[email protected]>
- Loading branch information
Showing
5 changed files
with
34 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters