Mesa (vulkan): nir/spirv: Allow but warn for a few capabilities

Jason Ekstrand jekstrand at kemper.freedesktop.org
Wed Feb 24 06:07:45 UTC 2016


Module: Mesa
Branch: vulkan
Commit: c9564fd598573f609480f70a141b95900047ba58
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c9564fd598573f609480f70a141b95900047ba58

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Feb 23 22:02:41 2016 -0800

nir/spirv: Allow but warn for a few capabilities

Unfortunately, glslang gives us cull/clip distance and GS streams even if
the shader doesn't use it whenever a shader is declared as version 450.
This is a glslang bug, but we can easily enough ignore it for now.

---

 src/compiler/nir/spirv/spirv_to_nir.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/spirv/spirv_to_nir.c b/src/compiler/nir/spirv/spirv_to_nir.c
index 91f5c4b..cb069b9 100644
--- a/src/compiler/nir/spirv/spirv_to_nir.c
+++ b/src/compiler/nir/spirv/spirv_to_nir.c
@@ -2167,7 +2167,6 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
       case SpvCapabilitySampledImageArrayDynamicIndexing:
       case SpvCapabilityStorageBufferArrayDynamicIndexing:
       case SpvCapabilityStorageImageArrayDynamicIndexing:
-      case SpvCapabilityClipDistance:
       case SpvCapabilityImageRect:
       case SpvCapabilitySampledRect:
       case SpvCapabilitySampled1D:
@@ -2177,6 +2176,11 @@ vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode,
       case SpvCapabilityImageBuffer:
       case SpvCapabilityImageQuery:
          break;
+      case SpvCapabilityClipDistance:
+      case SpvCapabilityCullDistance:
+      case SpvCapabilityGeometryStreams:
+         fprintf(stderr, "WARNING: Unsupported SPIR-V Capability\n");
+         break;
       default:
          assert(!"Unsupported capability");
       }




More information about the mesa-commit mailing list