summaryrefslogtreecommitdiff
path: root/tests/compute/dynamic-dispatch-bindless-texture.slang
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compute/dynamic-dispatch-bindless-texture.slang')
-rw-r--r--tests/compute/dynamic-dispatch-bindless-texture.slang36
1 files changed, 14 insertions, 22 deletions
diff --git a/tests/compute/dynamic-dispatch-bindless-texture.slang b/tests/compute/dynamic-dispatch-bindless-texture.slang
index b02ca9686..ec21afeda 100644
--- a/tests/compute/dynamic-dispatch-bindless-texture.slang
+++ b/tests/compute/dynamic-dispatch-bindless-texture.slang
@@ -2,37 +2,29 @@
//TEST(compute):COMPARE_COMPUTE:-cpu
//TEST(compute):COMPARE_COMPUTE:-cuda
-[anyValueSize(16)]
-interface IInterface
+// Type must be marked `public` to ensure it is visible in the generated DLL.
+
+export struct MyImpl
{
- float run();
-}
+ Texture2D tex;
+ float run()
+ {
+ return tex.Load({0, 0, 0}).x;
+ }
+};
//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=gOutputBuffer
RWStructuredBuffer<uint> gOutputBuffer;
-//TEST_INPUT: set gCb = new StructuredBuffer<IInterface>{new MyImpl{Texture2D(size=8, content = one), Sampler}}
-StructuredBuffer<IInterface> gCb;
+//TEST_INPUT: set gCb = new StructuredBuffer<MyImpl>{new MyImpl{Texture2D(size=8, content = one)}}
+StructuredBuffer<MyImpl> gCb;
[numthreads(4, 1, 1)]
-void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
+void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
{
let tid = dispatchThreadID.x;
let inputVal : int = tid;
- IInterface v0 = gCb.Load(0);
- SamplerState sampler;
+ MyImpl v0 = gCb.Load(0);
let outputVal = v0.run();
gOutputBuffer[tid] = uint(trunc(outputVal));
-}
-
-
-// Type must be marked `public` to ensure it is visible in the generated DLL.
-export struct MyImpl : IInterface
-{
- Texture2D tex;
- SamplerState sampler;
- float run()
- {
- return tex.Sample(sampler, float2(0.0, 0.0)).x;
- }
-};
+} \ No newline at end of file