mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
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 <ian.d.romanick@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
This commit is contained in:
parent
0115f356ee
commit
aa228eb1a6
3 changed files with 16 additions and 26 deletions
|
|
@ -338,16 +338,6 @@ _mesa_has_compute_shaders(const struct gl_context *ctx)
|
|||
(ctx->API == API_OPENGLES2 && ctx->Version >= 31);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue