Skip to content

Commit 3af404d

Browse files
authored
CPU ABI improvements (shader-slang#1056)
* WIP: Improving CPU performance/ABI * Optionally output code on CPU for groupThreadID and groupID. * Added ability to set compute dispatch size on command line for render-test. Dispatch compute tests taking into account dispatch size. Added test for semantics are working. * Test using GroupRange. * Fix problem with adding \n for externa diagnostic - to do it if there isn't a \n at the end. Change the ouput order (put result before) so last value is diagnostic string.
1 parent 3758a50 commit 3af404d

11 files changed

+367
-114
lines changed

prelude/slang-cpp-types.h

+6
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,12 @@ struct ComputeVaryingInput
232232
uint3 groupThreadID;
233233
};
234234

235+
struct GroupComputeVaryingInput
236+
{
237+
uint3 startGroupID; ///< start groupID
238+
uint3 endGroupID; ///< Non inclusive end groupID
239+
};
240+
235241
/* Type that defines the uniform entry point params. The actual content of this type is dependent on the entry point parameters, and can be
236242
found via reflection or defined such that it matches the shader appropriately. */
237243
struct UniformEntryPointParams;

source/slang/slang-compiler.cpp

+9-5
Original file line numberDiff line numberDiff line change
@@ -789,11 +789,6 @@ namespace Slang
789789
builder << compilerName << ": ";
790790
}
791791

792-
if (diagnostic.size() > 0)
793-
{
794-
builder.Append(diagnostic);
795-
}
796-
797792
if (SLANG_FAILED(res) && res != SLANG_FAIL)
798793
{
799794
{
@@ -805,6 +800,15 @@ namespace Slang
805800
PlatformUtil::appendResult(res, builder);
806801
}
807802

803+
if (diagnostic.size() > 0)
804+
{
805+
builder.Append(diagnostic);
806+
if (!diagnostic.endsWith("\n"))
807+
{
808+
builder.Append("\n");
809+
}
810+
}
811+
808812
sink->diagnoseRaw(severity, builder.getUnownedSlice());
809813
}
810814

0 commit comments

Comments
 (0)