mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 17:50:12 +01:00
mesa: fix incorrect error in _mesa_BindTextureUnit()
If the texture object exists, but the Name field is zero, it means the object was created but never bound to a target. Trying to bind it in _mesa_BindTextureUnit() should generate GL_INVALID_OPERATION. Fixes piglit's arb_direct_state_access-bind-texture-unit test. Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
This commit is contained in:
parent
a9408f3ca1
commit
1c6689bf03
1 changed files with 2 additions and 1 deletions
|
|
@ -1816,7 +1816,8 @@ _mesa_BindTextureUnit(GLuint unit, GLuint texture)
|
|||
return;
|
||||
}
|
||||
if (texObj->Target == 0) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glBindTextureUnit(target)");
|
||||
/* Texture object was gen'd but never bound so the target is not set */
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION, "glBindTextureUnit(target)");
|
||||
return;
|
||||
}
|
||||
assert(valid_texture_object(texObj));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue