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.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index 643ef516f..c2ec1fa42 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -167,18 +167,12 @@ static bool
validate_shader_target(const struct gl_context *ctx, GLenum type)
{
switch (type) {
-#if FEATURE_ARB_fragment_shader
case GL_FRAGMENT_SHADER:
return ctx->Extensions.ARB_fragment_shader;
-#endif
-#if FEATURE_ARB_vertex_shader
case GL_VERTEX_SHADER:
return ctx->Extensions.ARB_vertex_shader;
-#endif
-#if FEATURE_ARB_geometry_shader4
case GL_GEOMETRY_SHADER_ARB:
return _mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_geometry_shader4;
-#endif
default:
return false;
}
@@ -473,21 +467,17 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
struct gl_shader_program *shProg
= _mesa_lookup_shader_program(ctx, program);
-#if FEATURE_EXT_transform_feedback
/* Is transform feedback available in this context?
*/
const bool has_xfb =
(ctx->API == API_OPENGL && ctx->Extensions.EXT_transform_feedback)
|| ctx->API == API_OPENGL_CORE
|| _mesa_is_gles3(ctx);
-#endif
-#if FEATURE_ARB_geometry_shader4
/* Are geometry shaders available in this context?
*/
const bool has_gs =
_mesa_is_desktop_gl(ctx) && ctx->Extensions.ARB_geometry_shader4;
-#endif
/* Are uniform buffer objects available in this context?
*/
@@ -542,7 +532,6 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
*params = max_len;
return;
}
-#if FEATURE_EXT_transform_feedback
case GL_TRANSFORM_FEEDBACK_VARYINGS:
if (!has_xfb)
break;
@@ -558,8 +547,6 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
break;
*params = shProg->TransformFeedback.BufferMode;
return;
-#endif
-#if FEATURE_ARB_geometry_shader4
case GL_GEOMETRY_VERTICES_OUT_ARB:
if (!has_gs)
break;
@@ -575,7 +562,6 @@ get_programiv(struct gl_context *ctx, GLuint program, GLenum pname, GLint *param
break;
*params = shProg->Geom.OutputType;
return;
-#endif
case GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH: {
unsigned i;
GLint max_len = 0;
@@ -860,7 +846,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
struct gl_shader_program **target;
switch (type) {
-#if FEATURE_ARB_vertex_shader
case GL_VERTEX_SHADER:
target = &ctx->Shader.CurrentVertexProgram;
if ((shProg == NULL)
@@ -868,8 +853,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
shProg = NULL;
}
break;
-#endif
-#if FEATURE_ARB_geometry_shader4
case GL_GEOMETRY_SHADER_ARB:
target = &ctx->Shader.CurrentGeometryProgram;
if ((shProg == NULL)
@@ -877,8 +860,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
shProg = NULL;
}
break;
-#endif
-#if FEATURE_ARB_fragment_shader
case GL_FRAGMENT_SHADER:
target = &ctx->Shader.CurrentFragmentProgram;
if ((shProg == NULL)
@@ -886,7 +867,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
shProg = NULL;
}
break;
-#endif
default:
return false;
}
@@ -899,17 +879,12 @@ use_shader_program(struct gl_context *ctx, GLenum type,
* semantics of glDeleteProgram are maintained.
*/
switch (type) {
-#if FEATURE_ARB_vertex_shader
case GL_VERTEX_SHADER:
/* Empty for now. */
break;
-#endif
-#if FEATURE_ARB_geometry_shader4
case GL_GEOMETRY_SHADER_ARB:
/* Empty for now. */
break;
-#endif
-#if FEATURE_ARB_fragment_shader
case GL_FRAGMENT_SHADER:
if (*target == ctx->Shader._CurrentFragmentProgram) {
_mesa_reference_shader_program(ctx,
@@ -917,7 +892,6 @@ use_shader_program(struct gl_context *ctx, GLenum type,
NULL);
}
break;
-#endif
}
_mesa_reference_shader_program(ctx, target, shProg);
@@ -1533,8 +1507,6 @@ _mesa_ShaderBinary(GLint n, const GLuint* shaders, GLenum binaryformat,
#endif /* FEATURE_ES2 */
-#if FEATURE_ARB_geometry_shader4
-
void GLAPIENTRY
_mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value)
{
@@ -1596,8 +1568,6 @@ _mesa_ProgramParameteriARB(GLuint program, GLenum pname, GLint value)
}
}
-#endif
-
void
_mesa_use_shader_program(struct gl_context *ctx, GLenum type,
struct gl_shader_program *shProg)
@@ -1752,15 +1722,12 @@ _mesa_init_shader_dispatch(struct _glapi_table *exec)
SET_IsProgram(exec, _mesa_IsProgram);
SET_IsShader(exec, _mesa_IsShader);
-#if FEATURE_ARB_vertex_shader
+ /* GL_ARB_vertex_shader */
SET_BindAttribLocationARB(exec, _mesa_BindAttribLocationARB);
SET_GetActiveAttribARB(exec, _mesa_GetActiveAttribARB);
SET_GetAttribLocationARB(exec, _mesa_GetAttribLocationARB);
-#endif
-#if FEATURE_ARB_geometry_shader4
SET_ProgramParameteriARB(exec, _mesa_ProgramParameteriARB);
-#endif
SET_UseShaderProgramEXT(exec, _mesa_UseShaderProgramEXT);
SET_ActiveProgramEXT(exec, _mesa_ActiveProgramEXT);