nir/spirv: Allow but warn for a few capabilities
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 24 Feb 2016 06:02:41 +0000 (22:02 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 24 Feb 2016 06:07:25 +0000 (22:07 -0800)
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

index 91f5c4b5186e3a9105848313733bf9d58ed5c5aa..cb069b93ae852a894eacefc5d86a4aa96f75d87c 100644 (file)
@@ -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");
       }