summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cross-compile/image-load.slang19
-rw-r--r--tests/cross-compile/image-load.slang.glsl23
2 files changed, 42 insertions, 0 deletions
diff --git a/tests/cross-compile/image-load.slang b/tests/cross-compile/image-load.slang
new file mode 100644
index 000000000..7f125bd5a
--- /dev/null
+++ b/tests/cross-compile/image-load.slang
@@ -0,0 +1,19 @@
+// image-load.slang
+
+// This test confirms that `.Load()` on a `RWTexure*`
+// gets properly converted to a call to `imageLoad`
+// and not just `texelFetch` as it would for a `Texture*`.
+
+//TEST:CROSS_COMPILE:-target spirv-assembly -entry main -stage compute
+
+struct Params
+{
+ RWTexture2DArray<float> tex;
+}
+
+ParameterBlock<Params> gParams;
+
+void main(uint3 tid : SV_DispatchThreadID)
+{
+ float f = gParams.tex.Load(int3(tid.xy, tid.z));
+}
diff --git a/tests/cross-compile/image-load.slang.glsl b/tests/cross-compile/image-load.slang.glsl
new file mode 100644
index 000000000..c7233c38c
--- /dev/null
+++ b/tests/cross-compile/image-load.slang.glsl
@@ -0,0 +1,23 @@
+// image-load.slang.glsl
+//TEST_IGNORE_FILE:
+
+#version 450
+
+#extension GL_EXT_samplerless_texture_functions : require
+
+layout(r32f)
+layout(binding = 0)
+uniform image2DArray gParams_tex_0;
+
+layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
+
+void main()
+{
+ float _S1 = imageLoad(
+ gParams_tex_0,
+ ivec3(
+ ivec2(gl_GlobalInvocationID.xy),
+ int(gl_GlobalInvocationID.z))).x;
+
+ return;
+}