@@ -370,7 +370,10 @@ std::vector<VkRayTracingShaderGroupCreateInfoKHR> BuildRTShaderGroupDescription(
370370 if (pShader == nullptr )
371371 return VK_SHADER_UNUSED_KHR;
372372
373- const auto ShaderType = pShader->GetDesc ().ShaderType ;
373+ RefCntAutoPtr<ShaderVkImpl> pShaderVk{const_cast <IShader*>(pShader), ShaderVkImpl::IID_InternalImpl};
374+ VERIFY (pShaderVk, " Unexpected shader object implementation" );
375+
376+ const auto ShaderType = pShaderVk->GetDesc ().ShaderType ;
374377 // Shader modules are initialized in the same order by InitPipelineShaderStages().
375378 uint32_t idx = 0 ;
376379 for (const auto & Stage : ShaderStages)
@@ -379,18 +382,18 @@ std::vector<VkRayTracingShaderGroupCreateInfoKHR> BuildRTShaderGroupDescription(
379382 {
380383 for (Uint32 i = 0 ; i < Stage.Shaders .size (); ++i, ++idx)
381384 {
382- if (Stage.Shaders [i] == pShader )
385+ if (Stage.Shaders [i] == pShaderVk )
383386 return idx;
384387 }
385- UNEXPECTED (" Unable to find shader '" , pShader ->GetDesc ().Name , " ' in the shader stage. This should never happen and is a bug." );
388+ UNEXPECTED (" Unable to find shader '" , pShaderVk ->GetDesc ().Name , " ' in the shader stage. This should never happen and is a bug." );
386389 return VK_SHADER_UNUSED_KHR;
387390 }
388391 else
389392 {
390393 idx += static_cast <Uint32>(Stage.Count ());
391394 }
392395 }
393- UNEXPECTED (" Unable to find corresponding shader stage for shader '" , pShader ->GetDesc ().Name , " '. This should never happen and is a bug." );
396+ UNEXPECTED (" Unable to find corresponding shader stage for shader '" , pShaderVk ->GetDesc ().Name , " '. This should never happen and is a bug." );
394397 return VK_SHADER_UNUSED_KHR;
395398 };
396399
0 commit comments