@@ -550,9 +550,7 @@ class CVulkanLogicalDevice final : public ILogicalDevice
550
550
551
551
const asset::ICPUBuffer* source = cpushader->getSPVorGLSL ();
552
552
553
- core::smart_refctd_ptr<asset::ICPUBuffer> spirv =
554
- core::smart_refctd_ptr_static_cast<asset::ICPUBuffer>(source->clone (1u ));
555
-
553
+ core::smart_refctd_ptr<asset::ICPUBuffer> spirv;
556
554
if (cpushader->containsGLSL ())
557
555
{
558
556
const char * begin = static_cast <const char *>(source->getPointer ());
@@ -577,6 +575,10 @@ class CVulkanLogicalDevice final : public ILogicalDevice
577
575
logger,
578
576
m_physicalDevice->getLimits ().spirvVersion );
579
577
}
578
+ else
579
+ {
580
+ spirv = core::smart_refctd_ptr_static_cast<asset::ICPUBuffer>(source->clone (1u ));
581
+ }
580
582
581
583
if (!spirv)
582
584
return nullptr ;
@@ -591,7 +593,7 @@ class CVulkanLogicalDevice final : public ILogicalDevice
591
593
if (m_devf.vk .vkCreateShaderModule (m_vkdev, &vk_createInfo, nullptr , &vk_shaderModule) == VK_SUCCESS)
592
594
{
593
595
return core::make_smart_refctd_ptr<video::CVulkanShader>(
594
- core::smart_refctd_ptr<CVulkanLogicalDevice>(this ), std::move (spirv), cpushader->getStage (), std::string (cpushader->getFilepathHint ()), vk_shaderModule);
596
+ core::smart_refctd_ptr<CVulkanLogicalDevice>(this ), cpushader->getStage (), std::string (cpushader->getFilepathHint ()), vk_shaderModule);
595
597
}
596
598
else
597
599
{
@@ -1132,14 +1134,6 @@ class CVulkanLogicalDevice final : public ILogicalDevice
1132
1134
1133
1135
const CVulkanShader* vulkanShader = static_cast <const CVulkanShader*>(_unspecialized);
1134
1136
1135
- auto spirv = core::smart_refctd_ptr<const asset::ICPUBuffer>(static_cast <const CVulkanShader*>(_unspecialized)->getSPV ());
1136
-
1137
- if (spvopt)
1138
- spirv = spvopt->optimize (spirv.get (), m_physicalDevice->getDebugCallback ()->getLogger ());
1139
-
1140
- if (!spirv)
1141
- return nullptr ;
1142
-
1143
1137
return core::make_smart_refctd_ptr<CVulkanSpecializedShader>(
1144
1138
core::smart_refctd_ptr<CVulkanLogicalDevice>(this ),
1145
1139
core::smart_refctd_ptr<const CVulkanShader>(vulkanShader), specInfo);
0 commit comments