SPV: Fix #1016: Don't allow non-GLSL-extension protected Layer and ViewportIndex members.

This commit is contained in:
John Kessenich
2017-08-17 23:49:39 -06:00
parent 03e63fa805
commit d6be6da031
5 changed files with 124 additions and 57 deletions

View File

@@ -2465,6 +2465,10 @@ bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member)
if (member.getFieldName() == "gl_ViewportMaskPerViewNV" &&
extensions.find("GL_NVX_multiview_per_view_attributes") == extensions.end())
return true;
if ((member.getFieldName() == "gl_ViewportIndex" || member.getFieldName() == "gl_Layer") &&
extensions.find(glslang::E_GL_ARB_shader_viewport_layer_array) == extensions.end() &&
extensions.find(glslang::E_GL_NV_viewport_array2) == extensions.end())
return true;
return false;
};