diff options
| author | Yong He <yonghe@outlook.com> | 2024-03-11 14:42:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-11 14:42:14 -0700 |
| commit | 1bbcf25af514a9ae24f7006747177f2d1b3b7c0d (patch) | |
| tree | f42c17d32040d033742e741548e7b73ff24a5e92 /tools | |
| parent | 25a7d51445e64253beca5c4f70ddd52f40226b1d (diff) | |
Link-time specialization fixes. (#3734)
* Fix method synthesis logic for static differentiable methods.
* Support link-time constants in thread group size reflection.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/gfx-unit-test/link-time-constant.cpp | 6 | ||||
| -rw-r--r-- | tools/gfx-unit-test/link-time-type.cpp | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/gfx-unit-test/link-time-constant.cpp b/tools/gfx-unit-test/link-time-constant.cpp index b349a7dcb..58b39a204 100644 --- a/tools/gfx-unit-test/link-time-constant.cpp +++ b/tools/gfx-unit-test/link-time-constant.cpp @@ -79,9 +79,13 @@ namespace gfx_test R"( export static const bool turnOnFeature = true; export static const float constValue = 2.0; - export static const int numthread = 1; + export static const int numthread = 2; export static const int arraySize = 4; )")); + + SlangUInt threadGroupSizes[3]; + slangReflection->findEntryPointByName("computeMain")->getComputeThreadGroupSize(3, threadGroupSizes); + SLANG_CHECK(threadGroupSizes[0] == 2 && threadGroupSizes[1] == 1 && threadGroupSizes[2] == 1); ComputePipelineStateDesc pipelineDesc = {}; pipelineDesc.program = shaderProgram.get(); diff --git a/tools/gfx-unit-test/link-time-type.cpp b/tools/gfx-unit-test/link-time-type.cpp index 32a6b6775..66a886c16 100644 --- a/tools/gfx-unit-test/link-time-type.cpp +++ b/tools/gfx-unit-test/link-time-type.cpp @@ -20,6 +20,8 @@ namespace gfx_test { [Differentiable] float getBaseValue(); + [Differentiable] + static float getBaseValueS(); } interface IFoo : IBase { @@ -36,6 +38,8 @@ namespace gfx_test float getValue() { return val + 1.0; } [Differentiable] float getBaseValue() { return val; } + [Differentiable] + static float getBaseValueS() { return 0.0; } property float val2 { get { return val + 2.0; } set { val = newValue; } |
