X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Ftexstate.h;h=52fe60275c23095d273c9aeb2d9a4659062fe1d9;hb=4807a83da0e0f5e3272e85504ee3b2213ef1910a;hp=ce7b5d7f2d1e0bb8f7670a7fc875b911c6db2374;hpb=bfcdb843830bba0190e00e35e3c5c18c4bdb5de1;p=mesa.git diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h index ce7b5d7f2d1..52fe60275c2 100644 --- a/src/mesa/main/texstate.h +++ b/src/mesa/main/texstate.h @@ -41,7 +41,7 @@ static inline struct gl_texture_unit * _mesa_get_tex_unit(struct gl_context *ctx, GLuint unit) { - assert(unit < Elements(ctx->Texture.Unit)); + assert(unit < ARRAY_SIZE(ctx->Texture.Unit)); return &(ctx->Texture.Unit[unit]); } @@ -63,24 +63,6 @@ _mesa_max_tex_unit(struct gl_context *ctx) ctx->Const.MaxTextureCoordUnits); } -static inline struct gl_texture_unit * -_mesa_get_tex_unit_err(struct gl_context *ctx, GLuint unit, const char *func) -{ - if (unit < _mesa_max_tex_unit(ctx)) - return _mesa_get_tex_unit(ctx, unit); - - /* Note: This error is a precedent set by glBindTextures. From the GL 4.5 - * specification (30.10.2014) Section 8.1 ("Texture Objects"): - * - * "An INVALID_OPERATION error is generated if first + count is greater - * than the number of texture image units supported by the - * implementation." - */ - _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unit=%s)", func, - _mesa_lookup_enum_by_nr(GL_TEXTURE0+unit)); - return NULL; -} - extern void _mesa_copy_texture_state( const struct gl_context *src, struct gl_context *dst );