Don't emit NV-specific interface members if NV extensions are disabled.

This commit is contained in:
Rex Xu 2017-03-29 23:01:36 +08:00
parent aa3c64c214
commit bcf291a7ba

View File

@ -2272,12 +2272,21 @@ bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member)
{
auto& extensions = glslangIntermediate->getRequestedExtensions();
if (member.getFieldName() == "gl_ViewportMask" &&
extensions.find("GL_NV_viewport_array2") == extensions.end())
return true;
if (member.getFieldName() == "gl_SecondaryViewportMaskNV" &&
extensions.find("GL_NV_stereo_view_rendering") == extensions.end())
return true;
if (member.getFieldName() == "gl_SecondaryPositionNV" &&
extensions.find("GL_NV_stereo_view_rendering") == extensions.end())
return true;
if (member.getFieldName() == "gl_PositionPerViewNV" &&
extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end())
return true;
if (member.getFieldName() == "gl_ViewportMaskPerViewNV" &&
extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end())
return true;
return false;
};