summaryrefslogtreecommitdiff
path: root/tests/compute/half-texture.slang.glsl
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-05-22 12:00:21 -0400
committerTim Foley <tfoleyNV@users.noreply.github.com>2019-05-22 09:00:20 -0700
commit3247174cdb00836435794e3f07daad70bc92b66f (patch)
treed83ccbb72ae3d5eb66c14fcaff7984962549010e /tests/compute/half-texture.slang.glsl
parent7a24a4285c342ca5dea9a3b3fe176c4348aa9a51 (diff)
Hotfix/improve glsl semantic conversion review (#968)
* Small changes based on review * Remove the explicit 'nominal' tests * Made isValueEqual and isEqual on on IRConstant take a pointer * Small improvements to comments, and clarity of using 'nominal' * Simplify comparison by just using isTypeOperandEqual as basis for isTypeEqual * Use cross compile to test half-texture.slang on glsl * Don't need half-texture.slang.expected * Fix handling of nominal comparison based on review, ensuring that for nominal insts, they can only be compared by pointer.
Diffstat (limited to 'tests/compute/half-texture.slang.glsl')
-rw-r--r--tests/compute/half-texture.slang.glsl41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/compute/half-texture.slang.glsl b/tests/compute/half-texture.slang.glsl
new file mode 100644
index 000000000..88f585378
--- /dev/null
+++ b/tests/compute/half-texture.slang.glsl
@@ -0,0 +1,41 @@
+//TEST_IGNORE_FILE:
+#version 450
+layout(row_major) uniform;
+layout(row_major) buffer;
+#extension GL_EXT_shader_16bit_storage : require
+#extension GL_EXT_shader_explicit_arithmetic_types : require
+
+layout(r16f)
+layout(binding = 1)
+uniform image2D halfTexture_0;
+
+layout(rg16f)
+layout(binding = 2)
+uniform image2D halfTexture2_0;
+
+layout(rgba16f)
+layout(binding = 3)
+uniform image2D halfTexture4_0;
+
+layout(std430, binding = 0) buffer _S1 {
+ int _data[];
+} outputBuffer_0;
+
+layout(local_size_x = 4, local_size_y = 4, local_size_z = 1) in;void main()
+{
+ ivec2 pos_0 = ivec2(gl_GlobalInvocationID.xy);
+ const float _S2 = 1.00000000000000000000 / 3.00000000000000000000;
+ ivec2 pos2_0 = ivec2(3 - pos_0.y, 3 - pos_0.x);
+
+ float16_t h_0 = (float16_t(imageLoad((halfTexture_0), ivec2((uvec2(pos2_0)))).x));
+ f16vec2 h2_0 = (f16vec2(imageLoad((halfTexture2_0), ivec2((uvec2(pos2_0)))).xy));
+ f16vec4 h4_0 = (f16vec4(imageLoad((halfTexture4_0), ivec2((uvec2(pos2_0))))));
+ imageStore((halfTexture_0), ivec2((uvec2(pos_0))), f16vec4(h2_0.x + h2_0.y, float16_t(0), float16_t(0), float16_t(0)));
+ imageStore((halfTexture2_0), ivec2((uvec2(pos_0))), f16vec4(h4_0.xy, float16_t(0), float16_t(0)));
+ imageStore((halfTexture4_0), ivec2((uvec2(pos_0))), f16vec4(h2_0, h_0, h_0));
+
+ int index_0 = pos_0.x + pos_0.y * 4;
+ ((outputBuffer_0)._data[(uint(index_0))]) = index_0;
+
+ return;
+} \ No newline at end of file