aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2016-08-19 13:44:01 +0100
committerIan Romanick <[email protected]>2016-08-26 15:03:14 -0700
commitaa228eb1a69b2b367583878f440423229d4d1ac3 (patch)
tree76da9cf87476857b23f75eedcd469dc77141fc0f /src/mesa/main
parent0115f356eec22b30a78847ac47caebae4c436b68 (diff)
mesa: Remove redundant _mesa_has_shader_subroutine
The checks in _mesa_has_shader_subroutine are slightly different than _mesa_has_ARB_shader_subroutine, but they're not different in a way that matters. The only way to have ctx->Version >= 40 is if ctx->Extensions.ARB_shader_subroutine is set. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/context.h10
-rw-r--r--src/mesa/main/program_resource.c16
-rw-r--r--src/mesa/main/shaderapi.c16
3 files changed, 16 insertions, 26 deletions
diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
index 187138897be..9a609dd61ff 100644
--- a/src/mesa/main/context.h
+++ b/src/mesa/main/context.h
@@ -339,16 +339,6 @@ _mesa_has_compute_shaders(const struct gl_context *ctx)
}
/**
- * Checks if the context supports shader subroutines.
- */
-static inline bool
-_mesa_has_shader_subroutine(const struct gl_context *ctx)
-{
- return ctx->API == API_OPENGL_CORE &&
- (ctx->Version >= 40 || ctx->Extensions.ARB_shader_subroutine);
-}
-
-/**
* Checks if the context supports tessellation.
*/
static inline GLboolean
diff --git a/src/mesa/main/program_resource.c b/src/mesa/main/program_resource.c
index 5726ce10a16..19aaf48f984 100644
--- a/src/mesa/main/program_resource.c
+++ b/src/mesa/main/program_resource.c
@@ -49,18 +49,18 @@ supported_interface_enum(struct gl_context *ctx, GLenum iface)
case GL_FRAGMENT_SUBROUTINE:
case GL_VERTEX_SUBROUTINE_UNIFORM:
case GL_FRAGMENT_SUBROUTINE_UNIFORM:
- return _mesa_has_shader_subroutine(ctx);
+ return _mesa_has_ARB_shader_subroutine(ctx);
case GL_GEOMETRY_SUBROUTINE:
case GL_GEOMETRY_SUBROUTINE_UNIFORM:
- return _mesa_has_geometry_shaders(ctx) && _mesa_has_shader_subroutine(ctx);
+ return _mesa_has_geometry_shaders(ctx) && _mesa_has_ARB_shader_subroutine(ctx);
case GL_COMPUTE_SUBROUTINE:
case GL_COMPUTE_SUBROUTINE_UNIFORM:
- return _mesa_has_compute_shaders(ctx) && _mesa_has_shader_subroutine(ctx);
+ return _mesa_has_compute_shaders(ctx) && _mesa_has_ARB_shader_subroutine(ctx);
case GL_TESS_CONTROL_SUBROUTINE:
case GL_TESS_EVALUATION_SUBROUTINE:
case GL_TESS_CONTROL_SUBROUTINE_UNIFORM:
case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM:
- return _mesa_has_tessellation(ctx) && _mesa_has_shader_subroutine(ctx);
+ return _mesa_has_tessellation(ctx) && _mesa_has_ARB_shader_subroutine(ctx);
default:
return false;
}
@@ -514,20 +514,20 @@ _mesa_GetProgramResourceLocation(GLuint program, GLenum programInterface,
case GL_VERTEX_SUBROUTINE_UNIFORM:
case GL_FRAGMENT_SUBROUTINE_UNIFORM:
- if (!_mesa_has_shader_subroutine(ctx))
+ if (!_mesa_has_ARB_shader_subroutine(ctx))
goto fail;
break;
case GL_GEOMETRY_SUBROUTINE_UNIFORM:
- if (!_mesa_has_geometry_shaders(ctx) || !_mesa_has_shader_subroutine(ctx))
+ if (!_mesa_has_geometry_shaders(ctx) || !_mesa_has_ARB_shader_subroutine(ctx))
goto fail;
break;
case GL_COMPUTE_SUBROUTINE_UNIFORM:
- if (!_mesa_has_compute_shaders(ctx) || !_mesa_has_shader_subroutine(ctx))
+ if (!_mesa_has_compute_shaders(ctx) || !_mesa_has_ARB_shader_subroutine(ctx))
goto fail;
break;
case GL_TESS_CONTROL_SUBROUTINE_UNIFORM:
case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM:
- if (!_mesa_has_tessellation(ctx) || !_mesa_has_shader_subroutine(ctx))
+ if (!_mesa_has_tessellation(ctx) || !_mesa_has_ARB_shader_subroutine(ctx))
goto fail;
break;
default:
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index d9699555497..4ebc39febbb 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -2344,7 +2344,7 @@ _mesa_GetSubroutineUniformLocation(GLuint program, GLenum shadertype,
GLenum resource_type;
gl_shader_stage stage;
- if (!_mesa_has_shader_subroutine(ctx)) {
+ if (!_mesa_has_ARB_shader_subroutine(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", api_name);
return -1;
}
@@ -2379,7 +2379,7 @@ _mesa_GetSubroutineIndex(GLuint program, GLenum shadertype,
GLenum resource_type;
gl_shader_stage stage;
- if (!_mesa_has_shader_subroutine(ctx)) {
+ if (!_mesa_has_ARB_shader_subroutine(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", api_name);
return -1;
}
@@ -2423,7 +2423,7 @@ _mesa_GetActiveSubroutineUniformiv(GLuint program, GLenum shadertype,
GLenum resource_type;
int count, i, j;
- if (!_mesa_has_shader_subroutine(ctx)) {
+ if (!_mesa_has_ARB_shader_subroutine(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", api_name);
return;
}
@@ -2509,7 +2509,7 @@ _mesa_GetActiveSubroutineUniformName(GLuint program, GLenum shadertype,
GLenum resource_type;
gl_shader_stage stage;
- if (!_mesa_has_shader_subroutine(ctx)) {
+ if (!_mesa_has_ARB_shader_subroutine(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", api_name);
return;
}
@@ -2548,7 +2548,7 @@ _mesa_GetActiveSubroutineName(GLuint program, GLenum shadertype,
GLenum resource_type;
gl_shader_stage stage;
- if (!_mesa_has_shader_subroutine(ctx)) {
+ if (!_mesa_has_ARB_shader_subroutine(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", api_name);
return;
}
@@ -2584,7 +2584,7 @@ _mesa_UniformSubroutinesuiv(GLenum shadertype, GLsizei count,
gl_shader_stage stage;
int i;
- if (!_mesa_has_shader_subroutine(ctx)) {
+ if (!_mesa_has_ARB_shader_subroutine(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", api_name);
return;
}
@@ -2667,7 +2667,7 @@ _mesa_GetUniformSubroutineuiv(GLenum shadertype, GLint location,
struct gl_linked_shader *sh;
gl_shader_stage stage;
- if (!_mesa_has_shader_subroutine(ctx)) {
+ if (!_mesa_has_ARB_shader_subroutine(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", api_name);
return;
}
@@ -2709,7 +2709,7 @@ _mesa_GetProgramStageiv(GLuint program, GLenum shadertype,
struct gl_linked_shader *sh;
gl_shader_stage stage;
- if (!_mesa_has_shader_subroutine(ctx)) {
+ if (!_mesa_has_ARB_shader_subroutine(ctx)) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s", api_name);
return;
}