From cb637db5d619bfdb9be592220ebf206e96be7402 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 24 Mar 2017 15:58:54 +0100 Subject: [PATCH] Handle GL_ARB_derivative_control --- spirv_glsl.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/spirv_glsl.cpp b/spirv_glsl.cpp index 78e9f65c..86e63bf3 100644 --- a/spirv_glsl.cpp +++ b/spirv_glsl.cpp @@ -5041,18 +5041,42 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) case OpDPdxFine: UFOP(dFdxFine); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension("GL_ARB_derivative_control"); break; case OpDPdyFine: UFOP(dFdyFine); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension("GL_ARB_derivative_control"); break; case OpDPdxCoarse: + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } UFOP(dFdxCoarse); + if (options.version < 450) + require_extension("GL_ARB_derivative_control"); break; case OpDPdyCoarse: UFOP(dFdyCoarse); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension("GL_ARB_derivative_control"); break; case OpFwidth: