summaryrefslogtreecommitdiffstats
path: root/tests/compute
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-09-26 23:56:06 -0700
committerGitHub <noreply@github.com>2023-09-27 14:56:06 +0800
commitebe8ddefc48478307d5f206cd3e40c41d28a36e3 (patch)
tree8e13977979909a26394eea532d8b95cd5ad0f6d1 /tests/compute
parentc5c8cfbb360d9a763f549df48636effde839eacd (diff)
Various SPIRV fixes. (#3231)
* Various SPIRV fixes. - Geometry shader support (WIP). - Fix texture get dimension and load. - Fold global GetElement(MakeArray/MakeVector) insts. - Call spvopt to inline all functions. - Translate OpImageSubscript. - Emit struct member names and global variable names. - Fix lowering of OpBitNot -> OpNot, instead of OpBitReverse. * Fix test. * Fix geometry shader. * Fix geometry shader emit. * Add atomic Image access test. * Fix tests. * don't fail if spirv-opt fails. * Update comments. * Fix test. * Cleanups. * indentation --------- Co-authored-by: Yong He <yhe@nvidia.com> Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
Diffstat (limited to 'tests/compute')
-rw-r--r--tests/compute/texture-sampling.slang17
-rw-r--r--tests/compute/texture-sampling.slang.expected.txt6
2 files changed, 19 insertions, 4 deletions
diff --git a/tests/compute/texture-sampling.slang b/tests/compute/texture-sampling.slang
index 12bdc80bf..9ef0075bb 100644
--- a/tests/compute/texture-sampling.slang
+++ b/tests/compute/texture-sampling.slang
@@ -1,4 +1,6 @@
-//TEST(compute):COMPARE_RENDER_COMPUTE: -shaderobj
+//TEST(compute):COMPARE_RENDER_COMPUTE: -shaderobj -output-using-type
+//TEST(compute):COMPARE_RENDER_COMPUTE: -shaderobj -output-using-type -vk
+
//TEST_INPUT: Texture1D(size=4, content = one):name=t1D
//TEST_INPUT: Texture2D(size=4, content = one):name=t2D
@@ -8,7 +10,7 @@
//TEST_INPUT: Texture2D(size=4, content = one, arrayLength=2):name=t2dArray
//TEST_INPUT: TextureCube(size=4, content = one, arrayLength=2):name=tCubeArray
//TEST_INPUT: Sampler:name=samplerState
-//TEST_INPUT: ubuffer(data=[0], stride=4):out,name=outputBuffer
+//TEST_INPUT: ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
Texture1D t1D;
Texture2D t2D;
@@ -100,7 +102,16 @@ FragmentStageOutput fragmentMain(FragmentStageInput input)
val += tCubeArray.Sample(samplerState, float4(uv, 0.5, 0.0));
val += tCube.Sample(samplerState, float3(uv, 0.5));
-
+
+ val += t2D.Load(int3(0), int2(0));
+ val += t2dArray.Load(int4(0));
+
+ val += t3D[int3(0)];
+
outputBuffer[0] = val.x;
+
+ int w, h, l, lods;
+ t2dArray.GetDimensions(0, w, h, l, lods);
+ outputBuffer[1] = w + h + l + lods;
return output;
}
diff --git a/tests/compute/texture-sampling.slang.expected.txt b/tests/compute/texture-sampling.slang.expected.txt
index acf037f69..1df249246 100644
--- a/tests/compute/texture-sampling.slang.expected.txt
+++ b/tests/compute/texture-sampling.slang.expected.txt
@@ -1 +1,5 @@
-40E00000 \ No newline at end of file
+type: float
+10.000000
+13.000000
+0.000000
+0.000000