summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorLaura Ekstrand <[email protected]>2015-03-04 14:07:50 -0800
committerLaura Ekstrand <[email protected]>2015-03-09 13:33:54 -0700
commitd03337306a59ec7a9c1b4bd37856a95c40c1c801 (patch)
tree7c2267167a41bd7279fdf407d2095c7dc8b9abd0 /src/mesa/main/teximage.c
parent768ca8b83e45b1d23c0d3af0b79cc19c1b3b6988 (diff)
main: Use _mesa_lookup_bufferobj_err to simplify Tex[ture]Buffer[Range].
v2: Review from Anuj Phogat - Split rebase of Tex[ture]Buffer[Range] - Closing curly brace on the same line as else Reviewed-by: Anuj Phogat <[email protected]>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 345a8ff8904..6374ec98a39 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -5303,11 +5303,12 @@ _mesa_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer)
return;
}
- bufObj = _mesa_lookup_bufferobj(ctx, buffer);
- if (!bufObj && buffer) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTexBuffer(buffer %u)", buffer);
- return;
- }
+ if (buffer) {
+ bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, "glTexBuffer");
+ if (!bufObj)
+ return;
+ } else
+ bufObj = NULL;
texObj = _mesa_get_current_tex_object(ctx, target);
if (!texObj)
@@ -5387,12 +5388,12 @@ _mesa_TextureBuffer(GLuint texture, GLenum internalFormat, GLuint buffer)
return;
}
- bufObj = _mesa_lookup_bufferobj(ctx, buffer);
- if (!bufObj && buffer) {
- _mesa_error(ctx, GL_INVALID_OPERATION, "glTextureBuffer(buffer %u)",
- buffer);
- return;
- }
+ if (buffer) {
+ bufObj = _mesa_lookup_bufferobj_err(ctx, buffer, "glTextureBuffer");
+ if (!bufObj)
+ return;
+ } else
+ bufObj = NULL;
/* Get the texture object by Name. */
texObj = _mesa_lookup_texture_err(ctx, texture,