@@ -557,6 +557,13 @@ class CVulkanLogicalDevice final : public ILogicalDevice
557
557
}
558
558
else
559
559
{
560
+ const char * begin = static_cast <const char *>(source->getPointer ());
561
+ const char * end = begin + source->getSize ();
562
+ std::string code (begin, end);
563
+
564
+ auto newCodeBuffer = core::make_smart_refctd_ptr<asset::CDummyCPUBuffer>(code.size () + 1u , code.data (), core::adopt_memory);
565
+ auto newCPUShader = core::make_smart_refctd_ptr<asset::ICPUShader>(std::move (newCodeBuffer), cpushader->getStage (), cpushader->getContentType (), std::string (cpushader->getFilepathHint ()));
566
+
560
567
auto compiler = m_compilerSet->getShaderCompiler (cpushader->getContentType ());
561
568
562
569
asset::IShaderCompiler::SCompilerOptions commonCompileOptions = {};
@@ -574,14 +581,14 @@ class CVulkanLogicalDevice final : public ILogicalDevice
574
581
if (cpushader->getContentType () == asset::ICPUShader::E_CONTENT_TYPE::ECT_HLSL)
575
582
{
576
583
// TODO: add specific HLSLCompiler::SOption params
577
- spirvShader = m_compilerSet->compileToSPIRV (cpushader .get (), commonCompileOptions);
584
+ spirvShader = m_compilerSet->compileToSPIRV (newCPUShader .get (), commonCompileOptions);
578
585
}
579
586
else if (cpushader->getContentType () == asset::ICPUShader::E_CONTENT_TYPE::ECT_GLSL)
580
587
{
581
- spirvShader = m_compilerSet->compileToSPIRV (cpushader .get (), commonCompileOptions);
588
+ spirvShader = m_compilerSet->compileToSPIRV (newCPUShader .get (), commonCompileOptions);
582
589
}
583
590
else
584
- spirvShader = m_compilerSet->compileToSPIRV (cpushader .get (), commonCompileOptions);
591
+ spirvShader = m_compilerSet->compileToSPIRV (newCPUShader .get (), commonCompileOptions);
585
592
586
593
}
587
594
0 commit comments