summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-10-19 06:31:49 -0700
committerPaul Berry <[email protected]>2012-11-01 11:25:27 -0700
commita21116f87e44aabb6cb1f040dd557eac98144dd8 (patch)
tree39467657e0473af5ce2834be0375e06c2efeac67 /src/mesa/main/shaderapi.c
parent5a1b40acf50955d727b15dc70703a19115bb3552 (diff)
dispatch: GLES1 fixes for _mesa_create_exec_table().
Currently, _mesa_create_exec_table() (in api_exec.c) is used for all APIs except GLES1. In GLES1, _mesa_create_exec_table_es1() (a code generated function) is used instead. In principle, this shouldn't be necessary. It should be possible for api_exec.c to contain the logic for populating the dispatch table for all API's. This patch paves the way for using _mesa_create_exec_table() instead of _mesa_create_exec_table_es1(), by making _mesa_create_exec_table() (and the functions it calls) expose the correct subset of desktop GL functions for GLES1. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c74
1 files changed, 39 insertions, 35 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index d40a3537670..ec1559d6fe7 100644
--- a/src/mesa/main/shaderapi.c
+++ b/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,34 +1705,36 @@ _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) {
+ 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 (_mesa_is_desktop_gl(ctx)) {
SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB);
SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT);
@@ -1741,20 +1743,22 @@ _mesa_init_shader_dispatch(const struct gl_context *ctx,
}
/* 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);
}