diff options
author | Paul Berry <[email protected]> | 2014-01-07 15:19:07 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2014-01-21 20:24:56 -0800 |
commit | 4a91675b262c8150c1542991e1018e924c72f337 (patch) | |
tree | a1000cbc2a2aa26a2ad226a4eae43409b66e7f4b /src/mesa/main/shaderobj.c | |
parent | 020919b2ae76192f0f35c0901be0e1069a87b7f2 (diff) |
mesa: use _mesa_validate_shader_target() more frequently.
This patch replaces code in _mesa_new_shader() and delete_shader_cb()
that checks the type of a shader with calls to
_mesa_validate_shader_target(). This has two advantages: it allows
for a more thorough check (since _mesa_validate_shader_target()
doesn't permit shader targets that aren't supported by the back-end),
and it reduces the amount of code that will need to be modified when
adding new shader stages.
Reviewed-by: Chris Forbes <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderobj.c')
-rw-r--r-- | src/mesa/main/shaderobj.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c index dc81bbc7717..4f4bb69a872 100644 --- a/src/mesa/main/shaderobj.c +++ b/src/mesa/main/shaderobj.c @@ -34,6 +34,7 @@ #include "main/context.h" #include "main/hash.h" #include "main/mtypes.h" +#include "main/shaderapi.h" #include "main/shaderobj.h" #include "main/uniforms.h" #include "program/program.h" @@ -105,8 +106,7 @@ struct gl_shader * _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type) { struct gl_shader *shader; - assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER || - type == GL_GEOMETRY_SHADER_ARB); + assert(_mesa_validate_shader_target(ctx, type)); shader = rzalloc(NULL, struct gl_shader); if (shader) { shader->Type = type; |