summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2015-09-30 11:48:07 -0600
committerBrian Paul <brianp@vmware.com>2015-10-01 07:45:43 -0600
commit1c6689bf03fe500cc1bc55d7c2039c0aa3ae095c (patch)
treec58eea3962b587070370cc4736746f7d067abc05 /src/mesa/main/texobj.c
parenta9408f3ca14f2fb6286bd66bad06ee1bde0d8697 (diff)
downloadexternal_mesa3d-1c6689bf03fe500cc1bc55d7c2039c0aa3ae095c.zip
external_mesa3d-1c6689bf03fe500cc1bc55d7c2039c0aa3ae095c.tar.gz
external_mesa3d-1c6689bf03fe500cc1bc55d7c2039c0aa3ae095c.tar.bz2
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>
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 105ec1e..173e43c 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -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));