Refactor: Move shader loading code to inner scope
This prevents the loaded shader data from persisting on the stack even when it is no longer needed.
This commit is contained in:
parent
d29d2434ab
commit
020993fb19
1 changed files with 17 additions and 17 deletions
|
@ -436,6 +436,12 @@ image::Bl dither::blue_noise(int width, int height, int threads,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// create compute pipeline.
|
||||||
|
VkPipelineLayout compute_pipeline_layout;
|
||||||
|
VkPipeline compute_pipeline;
|
||||||
|
utility::Cleanup cleanup_pipeline_layout{};
|
||||||
|
utility::Cleanup cleanup_pipeline{};
|
||||||
|
{
|
||||||
// Load shader.
|
// Load shader.
|
||||||
std::vector<char> shader;
|
std::vector<char> shader;
|
||||||
{
|
{
|
||||||
|
@ -453,12 +459,6 @@ image::Bl dither::blue_noise(int width, int height, int threads,
|
||||||
ifs.close();
|
ifs.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
// create compute pipeline.
|
|
||||||
VkPipelineLayout compute_pipeline_layout;
|
|
||||||
VkPipeline compute_pipeline;
|
|
||||||
utility::Cleanup cleanup_pipeline_layout{};
|
|
||||||
utility::Cleanup cleanup_pipeline{};
|
|
||||||
{
|
|
||||||
VkShaderModuleCreateInfo shader_module_create_info{};
|
VkShaderModuleCreateInfo shader_module_create_info{};
|
||||||
shader_module_create_info.sType =
|
shader_module_create_info.sType =
|
||||||
VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
|
VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
|
||||||
|
|
Loading…
Reference in a new issue