From 8aa57c3c152b1651e9de80832d553dfc8be33690 Mon Sep 17 00:00:00 2001 From: John Kessenich Date: Tue, 29 Jul 2014 18:28:31 +0000 Subject: [PATCH] Fix assert firing in debug mode from last check in. git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27543 e7fa87d3-cd2b-0410-9028-fcbf551c1848 --- glslang/MachineIndependent/Initialize.cpp | 56 ++++++++++++----------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index cff87e1a..9fa6e4c4 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -2193,27 +2193,9 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb // that cannot be declared with the text strings. // - // GL_ARB_shader_texture_lod functions usable only with the extension enabled - if (profile != EEsProfile) { - symbolTable.setFunctionExtensions("texture1DGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture1DProjGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture1DProjGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DProjGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DProjGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture3DGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture3DProjGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("textureCubeGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow1DGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow1DProjGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow2DGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow2DProjGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DRectGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DRectProjGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DRectProjGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow2DRectGradARB", 1, &GL_ARB_shader_texture_lod); - symbolTable.setFunctionExtensions("shadow2DRectProjGradARB", 1, &GL_ARB_shader_texture_lod); - } + // N.B.: a symbol should only be tagged once, and this function is called multiple times, once + // per stage that's used for this profile. So, stick common ones in the fragment stage to + // ensure they are tagged exactly once. switch(language) { case EShLangVertex: @@ -2256,6 +2238,32 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb symbolTable.setFunctionExtensions("shadow1DProjLod", 1, &GL_ARB_shader_texture_lod); symbolTable.setFunctionExtensions("shadow2DProjLod", 1, &GL_ARB_shader_texture_lod); } + + // GL_ARB_shader_texture_lod functions usable only with the extension enabled + if (profile != EEsProfile) { + symbolTable.setFunctionExtensions("texture1DGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture1DProjGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture3DGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture3DProjGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow1DGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow1DProjGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DProjGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DRectGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DRectProjGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DRectGradARB", 1, &GL_ARB_shader_texture_lod); + symbolTable.setFunctionExtensions("shadow2DRectProjGradARB", 1, &GL_ARB_shader_texture_lod); + } + + if (profile == EEsProfile) { + symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &GL_EXT_shader_texture_lod); + symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &GL_EXT_shader_texture_lod); + } + symbolTable.setVariableExtensions("gl_FragDepthEXT", 1, &GL_EXT_frag_depth); break; @@ -2268,12 +2276,6 @@ void IdentifyBuiltIns(int version, EProfile profile, EShLanguage language, TSymb break; } - if (profile == EEsProfile) { - symbolTable.setFunctionExtensions("texture2DGradEXT", 1, &GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("texture2DProjGradEXT", 1, &GL_EXT_shader_texture_lod); - symbolTable.setFunctionExtensions("textureCubeGradEXT", 1, &GL_EXT_shader_texture_lod); - } - // // Next, identify which built-ins have a mapping to an operator. // Those that are not identified as such are