mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
mesa: fix invalid target error handling for teximage
This commit moves the target check before using _mesa_get_current_tex_object to fix a "Mesa implementation error: bad target in _mesa_get_current_tex_object()" error. Fixes:9dd1f7cec0("mesa: pass gl_texture_object as arg to not depend on state") Reviewed-by: Marek Olšák <marek.olsak@amd.com> (cherry picked from commit16233797f4)
This commit is contained in:
parent
9a929cfef2
commit
5694c20188
1 changed files with 8 additions and 7 deletions
|
|
@ -2979,17 +2979,18 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
|
|||
|
||||
internalFormat = override_internal_format(internalFormat, width, height);
|
||||
|
||||
if (!no_error &&
|
||||
/* target error checking */
|
||||
!legal_teximage_target(ctx, dims, target)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "%s%uD(target=%s)",
|
||||
func, dims, _mesa_enum_to_string(target));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!texObj)
|
||||
texObj = _mesa_get_current_tex_object(ctx, target);
|
||||
|
||||
if (!no_error) {
|
||||
/* target error checking */
|
||||
if (!legal_teximage_target(ctx, dims, target)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "%s%uD(target=%s)",
|
||||
func, dims, _mesa_enum_to_string(target));
|
||||
return;
|
||||
}
|
||||
|
||||
/* general error checking */
|
||||
if (compressed) {
|
||||
if (compressed_texture_error_check(ctx, dims, target, texObj,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue