SPV: Fix unexpected declarations of capability and extension
This commit is contained in:
parent
36b218de91
commit
5e317ffe40
@ -480,16 +480,18 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
|||||||
return spv::BuiltInCullDistance;
|
return spv::BuiltInCullDistance;
|
||||||
|
|
||||||
case glslang::EbvViewportIndex:
|
case glslang::EbvViewportIndex:
|
||||||
builder.addCapability(spv::CapabilityMultiViewport);
|
if (!memberDeclaration) {
|
||||||
|
builder.addCapability(spv::CapabilityMultiViewport);
|
||||||
#ifdef NV_EXTENSIONS
|
#ifdef NV_EXTENSIONS
|
||||||
if (glslangIntermediate->getStage() == EShLangVertex ||
|
if (glslangIntermediate->getStage() == EShLangVertex ||
|
||||||
glslangIntermediate->getStage() == EShLangTessControl ||
|
glslangIntermediate->getStage() == EShLangTessControl ||
|
||||||
glslangIntermediate->getStage() == EShLangTessEvaluation)
|
glslangIntermediate->getStage() == EShLangTessEvaluation) {
|
||||||
{
|
|
||||||
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
||||||
builder.addCapability(spv::CapabilityShaderViewportIndexLayerNV);
|
builder.addCapability(spv::CapabilityShaderViewportIndexLayerNV);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
return spv::BuiltInViewportIndex;
|
return spv::BuiltInViewportIndex;
|
||||||
|
|
||||||
case glslang::EbvSampleId:
|
case glslang::EbvSampleId:
|
||||||
@ -505,19 +507,19 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
|||||||
return spv::BuiltInSampleMask;
|
return spv::BuiltInSampleMask;
|
||||||
|
|
||||||
case glslang::EbvLayer:
|
case glslang::EbvLayer:
|
||||||
builder.addCapability(spv::CapabilityGeometry);
|
if (!memberDeclaration) {
|
||||||
|
builder.addCapability(spv::CapabilityGeometry);
|
||||||
#ifdef NV_EXTENSIONS
|
#ifdef NV_EXTENSIONS
|
||||||
if (!memberDeclaration)
|
|
||||||
{
|
|
||||||
if (glslangIntermediate->getStage() == EShLangVertex ||
|
if (glslangIntermediate->getStage() == EShLangVertex ||
|
||||||
glslangIntermediate->getStage() == EShLangTessControl ||
|
glslangIntermediate->getStage() == EShLangTessControl ||
|
||||||
glslangIntermediate->getStage() == EShLangTessEvaluation)
|
glslangIntermediate->getStage() == EShLangTessEvaluation) {
|
||||||
{
|
|
||||||
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
||||||
builder.addCapability(spv::CapabilityShaderViewportIndexLayerNV);
|
builder.addCapability(spv::CapabilityShaderViewportIndexLayerNV);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
return spv::BuiltInLayer;
|
return spv::BuiltInLayer;
|
||||||
|
|
||||||
case glslang::EbvPosition: return spv::BuiltInPosition;
|
case glslang::EbvPosition: return spv::BuiltInPosition;
|
||||||
@ -640,8 +642,10 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
|
|||||||
|
|
||||||
#ifdef NV_EXTENSIONS
|
#ifdef NV_EXTENSIONS
|
||||||
case glslang::EbvViewportMaskNV:
|
case glslang::EbvViewportMaskNV:
|
||||||
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
if (!memberDeclaration) {
|
||||||
builder.addCapability(spv::CapabilityShaderViewportMaskNV);
|
builder.addExtension(spv::E_SPV_NV_viewport_array2);
|
||||||
|
builder.addCapability(spv::CapabilityShaderViewportMaskNV);
|
||||||
|
}
|
||||||
return spv::BuiltInViewportMaskNV;
|
return spv::BuiltInViewportMaskNV;
|
||||||
case glslang::EbvSecondaryPositionNV:
|
case glslang::EbvSecondaryPositionNV:
|
||||||
if (!memberDeclaration) {
|
if (!memberDeclaration) {
|
||||||
@ -2690,6 +2694,7 @@ void TGlslangToSpvTraverser::declareUseOfStructMember(const glslang::TTypeList&
|
|||||||
case glslang::EbvPointSize:
|
case glslang::EbvPointSize:
|
||||||
#ifdef NV_EXTENSIONS
|
#ifdef NV_EXTENSIONS
|
||||||
case glslang::EbvLayer:
|
case glslang::EbvLayer:
|
||||||
|
case glslang::EbvViewportIndex:
|
||||||
case glslang::EbvViewportMaskNV:
|
case glslang::EbvViewportMaskNV:
|
||||||
case glslang::EbvSecondaryPositionNV:
|
case glslang::EbvSecondaryPositionNV:
|
||||||
case glslang::EbvSecondaryViewportMaskNV:
|
case glslang::EbvSecondaryViewportMaskNV:
|
||||||
|
@ -5,7 +5,6 @@ Warning, version 450 is not yet complete; most version-specific features are pre
|
|||||||
// Generated by (magic number): 80001
|
// Generated by (magic number): 80001
|
||||||
// Id's are bound by 39
|
// Id's are bound by 39
|
||||||
|
|
||||||
Capability Geometry
|
|
||||||
Capability Tessellation
|
Capability Tessellation
|
||||||
Capability ShaderViewportMaskNV
|
Capability ShaderViewportMaskNV
|
||||||
Capability ShaderStereoViewNV
|
Capability ShaderStereoViewNV
|
||||||
|
@ -5,7 +5,6 @@ Warning, version 450 is not yet complete; most version-specific features are pre
|
|||||||
// Generated by (magic number): 80001
|
// Generated by (magic number): 80001
|
||||||
// Id's are bound by 25
|
// Id's are bound by 25
|
||||||
|
|
||||||
Capability Geometry
|
|
||||||
Capability Tessellation
|
Capability Tessellation
|
||||||
Capability MultiViewport
|
Capability MultiViewport
|
||||||
Capability ShaderViewportIndexLayerNV
|
Capability ShaderViewportIndexLayerNV
|
||||||
|
Loading…
x
Reference in New Issue
Block a user