Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2019-06-27 16:04:22 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2019-06-27 16:04:22 +0300
commitc76b99b7116561a5638cf9e652c7f961ea8451b7 (patch)
tree1e9d6bf2f99f74b024e0ac92ae3a74afec3a7800 /reference/opt/shaders/asm
parent656d129c0037cb62a16927d5d5e422b3cdab4da1 (diff)
Handle more cases with FP16 and texture sampling.
Diffstat (limited to 'reference/opt/shaders/asm')
-rw-r--r--reference/opt/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag19
-rw-r--r--reference/opt/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag.vk20
2 files changed, 39 insertions, 0 deletions
diff --git a/reference/opt/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag b/reference/opt/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag
new file mode 100644
index 00000000..e0feb493
--- /dev/null
+++ b/reference/opt/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag
@@ -0,0 +1,19 @@
+#version 450
+#if defined(GL_AMD_gpu_shader_half_float)
+#extension GL_AMD_gpu_shader_half_float : require
+#elif defined(GL_NV_gpu_shader5)
+#extension GL_NV_gpu_shader5 : require
+#else
+#error No extension available for FP16.
+#endif
+
+layout(binding = 0) uniform sampler2D uTexture;
+
+layout(location = 0) out f16vec4 FragColor;
+layout(location = 0) in f16vec2 UV;
+
+void main()
+{
+ FragColor = f16vec4(texture(uTexture, UV));
+}
+
diff --git a/reference/opt/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag.vk b/reference/opt/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag.vk
new file mode 100644
index 00000000..e13e4254
--- /dev/null
+++ b/reference/opt/shaders/asm/frag/texture-sampling-fp16.asm.vk.frag.vk
@@ -0,0 +1,20 @@
+#version 450
+#if defined(GL_AMD_gpu_shader_half_float)
+#extension GL_AMD_gpu_shader_half_float : require
+#elif defined(GL_EXT_shader_explicit_arithmetic_types_float16)
+#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require
+#else
+#error No extension available for FP16.
+#endif
+#extension GL_EXT_shader_16bit_storage : require
+
+layout(set = 0, binding = 0) uniform sampler2D uTexture;
+
+layout(location = 0) out f16vec4 FragColor;
+layout(location = 0) in f16vec2 UV;
+
+void main()
+{
+ FragColor = f16vec4(texture(uTexture, UV));
+}
+