aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/shaderapi.c')
-rw-r--r--mesalib/src/mesa/main/shaderapi.c76
1 files changed, 39 insertions, 37 deletions
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index d40a35376..9376b0f42 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -1692,7 +1692,7 @@ _mesa_init_shader_dispatch(const struct gl_context *ctx,
{
#if FEATURE_GL
/* GL_ARB_vertex/fragment_shader */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB);
SET_GetHandleARB(exec, _mesa_GetHandleARB);
SET_DetachObjectARB(exec, _mesa_DetachObjectARB);
@@ -1705,56 +1705,58 @@ _mesa_init_shader_dispatch(const struct gl_context *ctx,
SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB);
}
- SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB);
- SET_CompileShaderARB(exec, _mesa_CompileShaderARB);
- SET_LinkProgramARB(exec, _mesa_LinkProgramARB);
- SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB);
- SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB);
- SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB);
-
- /* OpenGL 2.0 */
- SET_AttachShader(exec, _mesa_AttachShader);
- SET_CreateProgram(exec, _mesa_CreateProgram);
- SET_CreateShader(exec, _mesa_CreateShader);
- SET_DeleteProgram(exec, _mesa_DeleteProgram);
- SET_DeleteShader(exec, _mesa_DeleteShader);
- SET_DetachShader(exec, _mesa_DetachShader);
- SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders);
- SET_GetProgramiv(exec, _mesa_GetProgramiv);
- SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog);
- SET_GetShaderiv(exec, _mesa_GetShaderiv);
- SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog);
- SET_IsProgram(exec, _mesa_IsProgram);
- SET_IsShader(exec, _mesa_IsShader);
-
- /* GL_ARB_vertex_shader */
- SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB);
- SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB);
- SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB);
-
- if (ctx->API != API_OPENGLES2) {
- SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB);
-
+ if (ctx->API != API_OPENGLES) {
+ SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB);
+ SET_CompileShaderARB(exec, _mesa_CompileShaderARB);
+ SET_LinkProgramARB(exec, _mesa_LinkProgramARB);
+ SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB);
+ SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB);
+ SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB);
+
+ /* OpenGL 2.0 */
+ SET_AttachShader(exec, _mesa_AttachShader);
+ SET_CreateProgram(exec, _mesa_CreateProgram);
+ SET_CreateShader(exec, _mesa_CreateShader);
+ SET_DeleteProgram(exec, _mesa_DeleteProgram);
+ SET_DeleteShader(exec, _mesa_DeleteShader);
+ SET_DetachShader(exec, _mesa_DetachShader);
+ SET_GetAttachedShaders(exec, _mesa_GetAttachedShaders);
+ SET_GetProgramiv(exec, _mesa_GetProgramiv);
+ SET_GetProgramInfoLog(exec, _mesa_GetProgramInfoLog);
+ SET_GetShaderiv(exec, _mesa_GetShaderiv);
+ SET_GetShaderInfoLog(exec, _mesa_GetShaderInfoLog);
+ SET_IsProgram(exec, _mesa_IsProgram);
+ SET_IsShader(exec, _mesa_IsShader);
+
+ /* GL_ARB_vertex_shader */
+ SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB);
+ SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB);
+ SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB);
+ }
+
+ if (ctx->API == API_OPENGL) {
SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT);
SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);
SET_CreateShaderProgramEXT(exec, _mesa_CreateShaderProgramEXT);
}
/* GL_EXT_gpu_shader4 / GL 3.0 */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_BindFragDataLocationEXT(exec, _mesa_BindFragDataLocation);
}
- if (ctx->API != API_OPENGLES2 || _mesa_is_gles3(ctx)) {
+ if (_mesa_is_desktop_gl(ctx) || _mesa_is_gles3(ctx)) {
SET_GetFragDataLocationEXT(exec, _mesa_GetFragDataLocation);
}
/* GL_ARB_ES2_compatibility */
- SET_ReleaseShaderCompiler(exec, _mesa_ReleaseShaderCompiler);
- SET_GetShaderPrecisionFormat(exec, _mesa_GetShaderPrecisionFormat);
- SET_ShaderBinary(exec, _mesa_ShaderBinary);
+ if (ctx->API != API_OPENGLES) {
+ SET_ReleaseShaderCompiler(exec, _mesa_ReleaseShaderCompiler);
+ SET_GetShaderPrecisionFormat(exec, _mesa_GetShaderPrecisionFormat);
+ SET_ShaderBinary(exec, _mesa_ShaderBinary);
+ }
/* GL_ARB_blend_func_extended */
- if (ctx->API != API_OPENGLES2) {
+ if (_mesa_is_desktop_gl(ctx)) {
SET_BindFragDataLocationIndexed(exec, _mesa_BindFragDataLocationIndexed);
SET_GetFragDataIndex(exec, _mesa_GetFragDataIndex);
}