From 3d435f7321c3f9241d33a0f7521573f21b548186 Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 4 Jan 2018 13:41:09 -0800 Subject: Bug fixes for Slang integration (#356) * fix #353 * move validateEntryPoint to after all entrypoints has been checked * bug fix: DeclRefType::SubstituteImpl should change ioDiff * bug fix: generic resource usage should have count of 1 instead of 0. * update test case --- tests/compute/global-type-param3.slang | 37 ++++++++++++++++++++++ .../compute/global-type-param3.slang.expected.txt | 1 + 2 files changed, 38 insertions(+) create mode 100644 tests/compute/global-type-param3.slang create mode 100644 tests/compute/global-type-param3.slang.expected.txt (limited to 'tests') diff --git a/tests/compute/global-type-param3.slang b/tests/compute/global-type-param3.slang new file mode 100644 index 000000000..05793dce4 --- /dev/null +++ b/tests/compute/global-type-param3.slang @@ -0,0 +1,37 @@ +//TEST(smoke,compute):COMPARE_COMPUTE:-xslang -use-ir +//TEST_INPUT: cbuffer(data=[1.0], stride=4):dxbinding(0),glbinding(0) +//TEST_INPUT: ubuffer(data=[0], stride=4):dxbinding(0),glbinding(0),out +//TEST_INPUT: type Impl + +RWStructuredBuffer outputBuffer; + +interface IBase +{ + float compute(); +} + +struct Impl : IBase +{ + float base; // = 1.0 + float compute() + { + return 1.0; + } +}; + +__generic_param TImpl : IBase; + +ParameterBlock impl; + +float doCompute(T t) +{ + return t.compute(); +} + +[numthreads(1, 1, 1)] +void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) +{ + uint tid = dispatchThreadID.x; + float outVal = doCompute(impl); + outputBuffer[tid] = outVal; +} \ No newline at end of file diff --git a/tests/compute/global-type-param3.slang.expected.txt b/tests/compute/global-type-param3.slang.expected.txt new file mode 100644 index 000000000..deb1c3630 --- /dev/null +++ b/tests/compute/global-type-param3.slang.expected.txt @@ -0,0 +1 @@ +3F800000 -- cgit v1.2.3