diff --git a/src/modules/graphics/vulkan/Shader.cpp b/src/modules/graphics/vulkan/Shader.cpp index ee596114c..94c06f53a 100644 --- a/src/modules/graphics/vulkan/Shader.cpp +++ b/src/modules/graphics/vulkan/Shader.cpp @@ -249,6 +249,8 @@ Shader::Shader(StrongRef stages[]) bool Shader::loadVolatile() { + device = vgfx->getDevice(); + computePipeline = VK_NULL_HANDLE; for (int i = 0; i < BUILTIN_MAX_ENUM; i++) @@ -738,8 +740,6 @@ void Shader::compileShaders() auto program = std::make_unique(); - device = vgfx->getDevice(); - const auto &enabledExtensions = vgfx->getEnabledOptionalDeviceExtensions(); for (int i = 0; i < SHADERSTAGE_MAX_ENUM; i++) @@ -983,8 +983,6 @@ void Shader::compileShaders() createInfo.codeSize = spirv.size() * sizeof(uint32_t); createInfo.pCode = spirv.data(); - auto device = vgfx->getDevice(); - VkShaderModule shaderModule; if (vkCreateShaderModule(device, &createInfo, nullptr, &shaderModule) != VK_SUCCESS)