X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fshaderapi.c;h=2ffd8be0eb40aad83240989d83dc9d4c28022211;hb=7f48278edc70ad0841cbee2c46add7653b4fac15;hp=030236e7350b296e5b4b77b4079b78be91e3edb9;hpb=d348b0c72d41603178c0923e276869c7280904c7;p=mesa.git diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 030236e7350..2ffd8be0eb4 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -41,6 +41,8 @@ #include "main/dispatch.h" #include "main/enums.h" #include "main/hash.h" +#include "main/mfeatures.h" +#include "main/mtypes.h" #include "main/shaderapi.h" #include "main/shaderobj.h" #include "program/program.h" @@ -48,6 +50,7 @@ #include "program/prog_uniform.h" #include "talloc.h" #include +#include "../glsl/glsl_parser_extras.h" /** Define this to enable shader substitution (see below) */ #define SHADER_SUBST 0 @@ -95,7 +98,7 @@ _mesa_init_shader_state(struct gl_context *ctx) * are generated by the GLSL compiler. */ struct gl_shader_compiler_options options; - GLuint i; + gl_shader_type sh; memset(&options, 0, sizeof(options)); options.MaxUnrollIterations = 32; @@ -103,8 +106,8 @@ _mesa_init_shader_state(struct gl_context *ctx) /* Default pragma settings */ options.DefaultPragmas.Optimize = GL_TRUE; - for(i = 0; i < MESA_SHADER_TYPES; ++i) - memcpy(&ctx->ShaderCompilerOptions[i], &options, sizeof(options)); + for (sh = 0; sh < MESA_SHADER_TYPES; ++sh) + memcpy(&ctx->ShaderCompilerOptions[sh], &options, sizeof(options)); ctx->Shader.Flags = get_shader_flags(); } @@ -1637,8 +1640,7 @@ _mesa_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, void GLAPIENTRY _mesa_ReleaseShaderCompiler(void) { - GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_OPERATION, __FUNCTION__); + _mesa_destroy_shader_compiler_caches(); } @@ -1881,6 +1883,9 @@ _mesa_init_shader_dispatch(struct _glapi_table *exec) SET_BindFragDataLocationEXT(exec, _mesa_BindFragDataLocation); SET_GetFragDataLocationEXT(exec, _mesa_GetFragDataLocation); + /* GL_ARB_ES2_compatibility */ + SET_ReleaseShaderCompiler(exec, _mesa_ReleaseShaderCompiler); + #endif /* FEATURE_GL */ }