@@ -526,6 +526,13 @@ class CVulkanLogicalDevice final : public ILogicalDevice
526
526
}
527
527
else
528
528
{
529
+ const char * begin = static_cast <const char *>(source->getPointer ());
530
+ const char * end = begin + source->getSize ();
531
+ std::string code (begin, end);
532
+
533
+ auto newCodeBuffer = core::make_smart_refctd_ptr<asset::CDummyCPUBuffer>(code.size () + 1u , code.data (), core::adopt_memory);
534
+ auto newCPUShader = core::make_smart_refctd_ptr<asset::ICPUShader>(std::move (newCodeBuffer), cpushader->getStage (), cpushader->getContentType (), std::string (cpushader->getFilepathHint ()));
535
+
529
536
auto compiler = m_compilerSet->getShaderCompiler (cpushader->getContentType ());
530
537
531
538
asset::IShaderCompiler::SCompilerOptions commonCompileOptions = {};
@@ -543,14 +550,14 @@ class CVulkanLogicalDevice final : public ILogicalDevice
543
550
if (cpushader->getContentType () == asset::ICPUShader::E_CONTENT_TYPE::ECT_HLSL)
544
551
{
545
552
// TODO: add specific HLSLCompiler::SOption params
546
- spirvShader = m_compilerSet->compileToSPIRV (cpushader .get (), commonCompileOptions);
553
+ spirvShader = m_compilerSet->compileToSPIRV (newCPUShader .get (), commonCompileOptions);
547
554
}
548
555
else if (cpushader->getContentType () == asset::ICPUShader::E_CONTENT_TYPE::ECT_GLSL)
549
556
{
550
- spirvShader = m_compilerSet->compileToSPIRV (cpushader .get (), commonCompileOptions);
557
+ spirvShader = m_compilerSet->compileToSPIRV (newCPUShader .get (), commonCompileOptions);
551
558
}
552
559
else
553
- spirvShader = m_compilerSet->compileToSPIRV (cpushader .get (), commonCompileOptions);
560
+ spirvShader = m_compilerSet->compileToSPIRV (newCPUShader .get (), commonCompileOptions);
554
561
555
562
}
556
563
0 commit comments