From 0629b22bf09ae6b3c3689c5f98492df7577bf0d2 Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 8 Mar 2024 18:08:24 -0800 Subject: Enhance link-time type test. (#3724) * Enhance link-time type test. * Fix. * Fix. --- tools/gfx-unit-test/link-time-type.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tools') 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(8.0)); + Slang::makeArray(11.0)); } SLANG_UNIT_TEST(linkTimeTypeD3D12) -- cgit v1.2.3