From 7f6559d2802d0653541060f0909e33d137b9c8ba Mon Sep 17 00:00:00 2001 From: Shahbaz Youssefi Date: Mon, 16 Nov 2020 12:22:34 -0500 Subject: [PATCH] Compile out code for GL_EXT_shader_image_int64 for ANGLE (#2463) Fixes a crash in ANGLE. Closes: #2452 --- glslang/MachineIndependent/Initialize.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index c765199b..d073f606 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -5436,6 +5436,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV "\n"); } + if (version >= 300 /* both ES and non-ES */) { + stageBuiltins[EShLangFragment].append( + "flat in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2 + "\n"); + } + #ifndef GLSLANG_ANGLE // GL_ARB_shader_ballot if (profile != EEsProfile && version >= 450) { @@ -5707,14 +5713,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV commonBuiltins.append("const int gl_StorageSemanticsOutput = 0x1000;\n"); } -#endif // !GLSLANG_ANGLE - - if (version >= 300 /* both ES and non-ES */) { - stageBuiltins[EShLangFragment].append( - "flat in highp uint gl_ViewID_OVR;" // GL_OVR_multiview, GL_OVR_multiview2 - "\n"); - } - // Adding these to common built-ins triggers an assert due to a memory corruption in related code when testing // So instead add to each stage individually, avoiding the GLSLang bug if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) { @@ -5764,6 +5762,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV } } } +#endif // !GLSLANG_ANGLE #endif // !GLSLANG_WEB