summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2024-03-08 18:08:24 -0800
committerGitHub <noreply@github.com>2024-03-08 18:08:24 -0800
commit0629b22bf09ae6b3c3689c5f98492df7577bf0d2 (patch)
tree286eaf6268986b1ecb3cc19e8f3b72495e881d78 /tools
parent21502874666c282a3c5fa1f802deff27fab4e93b (diff)
Enhance link-time type test. (#3724)
* Enhance link-time type test. * Fix. * Fix.
Diffstat (limited to 'tools')
-rw-r--r--tools/gfx-unit-test/link-time-type.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/gfx-unit-test/link-time-type.cpp b/tools/gfx-unit-test/link-time-type.cpp
index a522b6903..32a6b6775 100644
--- a/tools/gfx-unit-test/link-time-type.cpp
+++ b/tools/gfx-unit-test/link-time-type.cpp
@@ -16,7 +16,12 @@ namespace gfx_test
slang::ProgramLayout*& slangReflection)
{
const char* moduleInterfaceSrc = R"(
- interface IFoo
+ interface IBase : IDifferentiable
+ {
+ [Differentiable]
+ float getBaseValue();
+ }
+ interface IFoo : IBase
{
static const int offset;
[mutating] void setValue(float v);
@@ -29,6 +34,8 @@ namespace gfx_test
static const int offset = -1;
[mutating] void setValue(float v) { val = v; }
float getValue() { return val + 1.0; }
+ [Differentiable]
+ float getBaseValue() { return val; }
property float val2 {
get { return val + 2.0; }
set { val = newValue; }
@@ -44,7 +51,7 @@ namespace gfx_test
{
Foo foo;
foo.setValue(3.0);
- buffer[0] = foo.getValue() + foo.val2 + Foo.offset;
+ buffer[0] = foo.getValue() + foo.val2 + Foo.offset + foo.getBaseValue();
}
)";
const char* module1Src = R"(
@@ -169,7 +176,7 @@ namespace gfx_test
compareComputeResult(
device,
numbersBuffer,
- Slang::makeArray<float>(8.0));
+ Slang::makeArray<float>(11.0));
}
SLANG_UNIT_TEST(linkTimeTypeD3D12)