@@ -53,14 +53,18 @@ CHLSLCompiler::DxcCompilationResult CHLSLCompiler::dxcCompile(std::string& sourc
53
53
insertion << " \n " ;
54
54
insertIntoStart (source, std::move (insertion));
55
55
}
56
+
57
+ IDxcBlobEncoding* src;
58
+ auto res = m_dxcUtils->CreateBlob (reinterpret_cast <const void *>(source.data ()), source.size (), CP_UTF8, &src);
59
+ assert (SUCCEEDED (res));
56
60
57
61
DxcBuffer sourceBuffer;
58
- sourceBuffer.Ptr = source. data ();
59
- sourceBuffer.Size = source. size ();
62
+ sourceBuffer.Ptr = src-> GetBufferPointer ();
63
+ sourceBuffer.Size = src-> GetBufferSize ();
60
64
sourceBuffer.Encoding = 0 ;
61
65
62
66
IDxcResult* compileResult;
63
- auto res = m_dxcCompiler->Compile (&sourceBuffer, args, argCount, nullptr , IID_PPV_ARGS (&compileResult));
67
+ res = m_dxcCompiler->Compile (&sourceBuffer, args, argCount, nullptr , IID_PPV_ARGS (&compileResult));
64
68
// If the compilation failed, this should still be a successful result
65
69
assert (SUCCEEDED (res));
66
70
@@ -149,8 +153,8 @@ core::smart_refctd_ptr<ICPUShader> CHLSLCompiler::compileToSPIRV(const char* cod
149
153
L" -Qembed_debug" // Embeds debug information
150
154
};
151
155
152
- const uint32_t nonDebugArgs = 3 ;
153
- const uint32_t allArgs = nonDebugArgs + 1 ;
156
+ const uint32_t nonDebugArgs = 5 ;
157
+ const uint32_t allArgs = nonDebugArgs + 2 ;
154
158
155
159
DxcCompilationResult compileResult = dxcCompile (newCode, &arguments[0 ], hlslOptions.genDebugInfo ? allArgs : nonDebugArgs, hlslOptions);
156
160
0 commit comments