Skip to content

Commit

Permalink
Merge pull request #11 from shader-slang/matrix_layout
Browse files Browse the repository at this point in the history
Update slang compile flags to use row-major for matrix layout
  • Loading branch information
kaizhangNV authored Dec 23, 2024
2 parents 1b5dd37 + b164746 commit 7bf9c37
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions external/vulkancts/framework/vulkan/vkShaderToSpirV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,8 @@ namespace vk
<< " \""+stage + "\", \n"
<< " \"-entry\", \n"
<< " \"main\", \n"
<< " \"-allow-glsl\"\n"
<< " \"-allow-glsl\", \n"
<< " \"-matrix-layout-row-major\"\n"
<< " ]\n"
<< " ]\n"
<< "}\n";
Expand Down Expand Up @@ -1106,7 +1107,7 @@ namespace vk
// Now transform it into bitcode
SpirVProgramInfo buildInfo;
SpirVAsmSource program(spvasm);
if (!assembleSpirV(&program, dst, &buildInfo, SPIRV_VERSION_1_0))
if (!assembleSpirV(&program, dst, &buildInfo, SPIRV_VERSION_1_5))
return SLANG_FAIL;
return SLANG_OK;
}
Expand Down Expand Up @@ -1200,7 +1201,7 @@ namespace vk
compileRequest->addSearchPath(slangDllPath.c_str());
compileRequest->setDiagnosticCallback(&_diagnosticCallback, nullptr);
compileRequest->setCommandLineCompilerMode();
const char* args[] = { "-target", "spirv", "-stage", slangShaderStage.c_str(), "-entry", "main", "-allow-glsl", temp_fname.c_str(), "-o", "temp.spv" };
const char* args[] = { "-target", "spirv", "-stage", slangShaderStage.c_str(), "-entry", "main", "-allow-glsl", "-matrix-layout-row-major", temp_fname.c_str(), "-o", "temp.spv" };
int argCount = sizeof(args) / sizeof(char*);//8;
result = compileRequest->processCommandLineArguments(args, argCount);
if (result != SLANG_OK) {
Expand Down

0 comments on commit 7bf9c37

Please sign in to comment.