summaryrefslogtreecommitdiffstats
path: root/tools/gfx-unit-test/link-time-type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx-unit-test/link-time-type.cpp')
-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)