Add GeometryStreams capability
authorDavid Neto <dneto@google.com>
Thu, 12 Nov 2015 20:30:28 +0000 (15:30 -0500)
committerDavid Neto <dneto@google.com>
Thu, 12 Nov 2015 21:27:51 +0000 (16:27 -0500)
Decoration Stream depends on it.
GeometryStreams depends on Geometry capability.

Spot check dependence of OpEmitStreamVertex on GeometryStreams.
(Opcode dependencies on capabilities are automatically generated from
opcode.inc)

source/operand.cpp
test/OpcodeRequiresCapabilities.cpp
test/OperandCapabilities.cpp

index 99875c3..9bb3f5f 100644 (file)
@@ -577,7 +577,7 @@ static const spv_operand_desc_t decorationEntries[] = {
      {SPV_OPERAND_TYPE_NONE}},
     {"Stream",
      SpvDecorationStream,
-     SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometry),
+     SPV_CAPABILITY_AS_MASK(SpvCapabilityGeometryStreams),
      {SPV_OPERAND_TYPE_LITERAL_INTEGER, SPV_OPERAND_TYPE_NONE}},
     {"Location",
      SpvDecorationLocation,
@@ -1001,6 +1001,7 @@ static const spv_operand_desc_t capabilityInfoEntries[] = {
     CASE_CAP(DerivativeControl, Shader),
     CASE_CAP(InterpolationFunction, Shader),
     CASE_CAP(TransformFeedback, Shader),
+    CASE_CAP(GeometryStreams, Geometry),
 };
 #undef CASE
 #undef CASE_CAP
index 28a717c..0a6e5db 100644 (file)
@@ -76,8 +76,7 @@ TEST(OpcodeRequiresCapability, None) {
 
 TEST(CapabilityAsMaskMacro, Sample) {
   EXPECT_EQ(uint64_t(1), SPV_CAPABILITY_AS_MASK(SpvCapabilityMatrix));
-  EXPECT_EQ(uint64_t(0x8000),
-            SPV_CAPABILITY_AS_MASK(SpvCapabilityImageMipmap));
+  EXPECT_EQ(uint64_t(0x8000), SPV_CAPABILITY_AS_MASK(SpvCapabilityImageMipmap));
   EXPECT_EQ(uint64_t(0x100000000ULL),
             SPV_CAPABILITY_AS_MASK(SpvCapabilityClipDistance));
   EXPECT_EQ(uint64_t(1) << 53,
@@ -132,6 +131,8 @@ INSTANTIATE_TEST_CASE_P(
                                    mask(SpvCapabilityAddresses)},
         ExpectedOpCodeCapabilities{SpvOpArrayLength, mask(SpvCapabilityShader)},
         ExpectedOpCodeCapabilities{SpvOpFunction, 0},
-        ExpectedOpCodeCapabilities{SpvOpConvertFToS, 0}));
+        ExpectedOpCodeCapabilities{SpvOpConvertFToS, 0},
+        ExpectedOpCodeCapabilities{SpvOpEmitStreamVertex,
+                                   mask(SpvCapabilityGeometryStreams)}));
 
 }  // anonymous namespace
index f56b0a0..f983e92 100644 (file)
@@ -389,7 +389,7 @@ INSTANTIATE_TEST_CASE_P(
         CASE1(DECORATION, DecorationUniform, Shader),
         // Value 27 is an intentional gap in the spec numbering.
         CASE1(DECORATION, DecorationSaturatedConversion, Kernel),
-        CASE1(DECORATION, DecorationStream, Geometry),
+        CASE1(DECORATION, DecorationStream, GeometryStreams),
         CASE1(DECORATION, DecorationLocation, Shader),
         CASE1(DECORATION, DecorationComponent, Shader),
         CASE1(DECORATION, DecorationIndex, Shader),
@@ -607,6 +607,7 @@ INSTANTIATE_TEST_CASE_P(
         CASE1(CAPABILITY, CapabilityDerivativeControl, Shader),
         CASE1(CAPABILITY, CapabilityInterpolationFunction, Shader),
         CASE1(CAPABILITY, CapabilityTransformFeedback, Shader),
+        CASE1(CAPABILITY, CapabilityGeometryStreams, Geometry),
     }));
 
 #undef CASE0