mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 06:45:23 +00:00
Store shader bytecode as a static rather than on the stack. This fixes stack overflow errors for large shaders. (#1476)
Signed-off-by: Arc-blroth <45273859+Arc-blroth@users.noreply.github.com>
This commit is contained in:
parent
8c6ff4aba9
commit
ccb5a1091b
@ -4,6 +4,7 @@
|
|||||||
- Added basic VK_KHR_external_memory, VK_KHR_external_memory_fd, and VK_EXT_external_memory_dma_buf support.
|
- Added basic VK_KHR_external_memory, VK_KHR_external_memory_fd, and VK_EXT_external_memory_dma_buf support.
|
||||||
- Fixed potential segmentation fault in `ComputePipeline` when referencing `PipelineCache` objects.
|
- Fixed potential segmentation fault in `ComputePipeline` when referencing `PipelineCache` objects.
|
||||||
- Fixed race condition in `StandardCommandPool` when allocating buffers.
|
- Fixed race condition in `StandardCommandPool` when allocating buffers.
|
||||||
|
- Fixed potential stack overflow error in loading large shaders by storing the bytecode as static.
|
||||||
|
|
||||||
# Version 0.20.0 (2020-12-26)
|
# Version 0.20.0 (2020-12-26)
|
||||||
|
|
||||||
|
@ -308,11 +308,11 @@ pub(super) fn reflect(
|
|||||||
-> Result<#struct_name, ::vulkano::OomError>
|
-> Result<#struct_name, ::vulkano::OomError>
|
||||||
{
|
{
|
||||||
#( #cap_checks )*
|
#( #cap_checks )*
|
||||||
let words = [ #( #spirv ),* ];
|
static WORDS: &[u32] = &[ #( #spirv ),* ];
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
Ok(#struct_name {
|
Ok(#struct_name {
|
||||||
shader: ::vulkano::pipeline::shader::ShaderModule::from_words(device, &words)?
|
shader: ::vulkano::pipeline::shader::ShaderModule::from_words(device, WORDS)?
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user