Skip to content

Commit

Permalink
Fix -capability arg in SPIRV debug command line output. (#6114)
Browse files Browse the repository at this point in the history
  • Loading branch information
csyonghe authored Jan 17, 2025
1 parent 3666c66 commit e743c17
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
16 changes: 13 additions & 3 deletions source/slang/slang-compiler-options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,21 @@ void CompilerOptionSet::writeCommandLineArgs(Session* globalSession, StringBuild
switch (option.key)
{
case CompilerOptionName::Capability:
for (auto v : option.value)
{
sb << " " << optionInfo.names << " " << v.stringValue;
StringBuilder subBuilder;
for (auto v : option.value)
{
if (subBuilder.getLength() != 0)
subBuilder << "+";
if (v.kind == CompilerOptionValueKind::Int)
subBuilder << capabilityNameToString((CapabilityName)v.intValue);
else
subBuilder << v.stringValue;
}
if (subBuilder.getLength())
sb << " " << optionInfo.names << " " << subBuilder.produceString();
break;
}
break;
case CompilerOptionName::Include:
for (auto v : option.value)
{
Expand Down
5 changes: 5 additions & 0 deletions tests/spirv/cmd-arg-debug-info.slang
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//TEST:SIMPLE(filecheck=CHECK): -target spirv -g3 -emit-spirv-directly -profile sm_6_6+spirv_1_5
// CHECK: OpString "-target spirv {{.*}} -capability spirv_1_5
[numthreads(1,1,1)]
void computeMain()
{}

0 comments on commit e743c17

Please sign in to comment.