From 7f8a9994d0bd99a171a1daa0bce46d92c02ccffd Mon Sep 17 00:00:00 2001 From: Yong He Date: Fri, 21 May 2021 16:38:33 -0700 Subject: [gfx] Support StructuredBuffer. (#1851) Co-authored-by: T. Foley --- tests/compute/dynamic-dispatch-13.slang | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'tests/compute/dynamic-dispatch-13.slang') diff --git a/tests/compute/dynamic-dispatch-13.slang b/tests/compute/dynamic-dispatch-13.slang index 5acc981e1..d44029c23 100644 --- a/tests/compute/dynamic-dispatch-13.slang +++ b/tests/compute/dynamic-dispatch-13.slang @@ -1,9 +1,9 @@ // Test using interface typed shader parameters wrapped inside a `StructuredBuffer`. -//DISABLED_TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj -//DISABLED_TEST(compute):COMPARE_COMPUTE:-dx11 -//DISABLED_TEST(compute):COMPARE_COMPUTE:-vk -//DISABLED_TEST(compute):COMPARE_COMPUTE:-cuda -shaderobj +//TEST(compute):COMPARE_COMPUTE:-cpu -shaderobj +//TEST(compute):COMPARE_COMPUTE:-dx11 +//TEST(compute):COMPARE_COMPUTE:-vk +//TEST(compute):COMPARE_COMPUTE:-cuda -shaderobj [anyValueSize(8)] interface IInterface @@ -11,13 +11,14 @@ interface IInterface int run(int input); } +// Specialize gCb1, but not gCb2 + //TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=gOutputBuffer RWStructuredBuffer gOutputBuffer; - -//TEST_INPUT:ubuffer(data=[rtti(MyImpl) witness(MyImpl, IInterface) 1 0], stride=4):name=gCb +//TEST_INPUT: set gCb = new StructuredBuffer{new MyImpl{1}}; RWStructuredBuffer gCb; - -//TEST_INPUT:ubuffer(data=[rtti(MyImpl) witness(MyImpl, IInterface) 1 0], stride=4):name=gCb1 +// Add two elements into the structured buffer to prevent specialization. +//TEST_INPUT: set gCb1 = new StructuredBuffer{new MyImpl{1}, new MyImpl2{2}}; RWStructuredBuffer gCb1; [numthreads(4, 1, 1)] @@ -33,9 +34,6 @@ void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) gOutputBuffer[tid] = outputVal; } -// Specialize gCb1, but not gCb2 -//TEST_INPUT: globalExistentialType MyImpl -//TEST_INPUT: globalExistentialType __Dynamic // Type must be marked `public` to ensure it is visible in the generated DLL. public struct MyImpl : IInterface { -- cgit v1.2.3