From 12511c8a4ffd8ee04f3a2cb407e618259081fdbd Mon Sep 17 00:00:00 2001 From: David Neto Date: Thu, 12 Nov 2015 15:30:28 -0500 Subject: [PATCH] Add GeometryStreams capability 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 | 3 ++- test/OpcodeRequiresCapabilities.cpp | 7 ++++--- test/OperandCapabilities.cpp | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/operand.cpp b/source/operand.cpp index 99875c3..9bb3f5f 100644 --- a/source/operand.cpp +++ b/source/operand.cpp @@ -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 diff --git a/test/OpcodeRequiresCapabilities.cpp b/test/OpcodeRequiresCapabilities.cpp index 28a717c..0a6e5db 100644 --- a/test/OpcodeRequiresCapabilities.cpp +++ b/test/OpcodeRequiresCapabilities.cpp @@ -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 diff --git a/test/OperandCapabilities.cpp b/test/OperandCapabilities.cpp index f56b0a0..f983e92 100644 --- a/test/OperandCapabilities.cpp +++ b/test/OperandCapabilities.cpp @@ -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 -- 2.7.4