diff options
author | Timothy Arceri <[email protected]> | 2017-05-05 16:25:11 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-05-11 13:53:39 +1000 |
commit | 304058a1fb209f25be65622202c1c21dcd6ceaf5 (patch) | |
tree | a6b759874a7509258c55992c6f54bad7c5a482e8 /src/mesa/main | |
parent | 69ca1ef683b9cb3baaae423e726a0b867e0dbc33 (diff) |
mesa: add error version of get_texture_for_framebuffer()
This is a step towards KHR_no_error support.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/fbobject.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index fb8fbe900d6..4759441becc 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -2910,6 +2910,16 @@ reuse_framebuffer_texture_attachment(struct gl_framebuffer *fb, } +static struct gl_texture_object * +get_texture_for_framebuffer(struct gl_context *ctx, GLuint texture) +{ + if (!texture) + return NULL; + + return _mesa_lookup_texture(ctx, texture); +} + + /** * Common code called by gl*FramebufferTexture*() to retrieve the correct * texture object pointer. @@ -2920,9 +2930,9 @@ reuse_framebuffer_texture_attachment(struct gl_framebuffer *fb, * \return true if no errors, false if errors */ static bool -get_texture_for_framebuffer(struct gl_context *ctx, GLuint texture, - bool layered, const char *caller, - struct gl_texture_object **texObj) +get_texture_for_framebuffer_err(struct gl_context *ctx, GLuint texture, + bool layered, const char *caller, + struct gl_texture_object **texObj) { *texObj = NULL; /* This will get returned if texture = 0. */ @@ -3312,7 +3322,7 @@ framebuffer_texture_with_dims(int dims, GLenum target, } /* Get the texture object */ - if (!get_texture_for_framebuffer(ctx, texture, false, caller, &texObj)) + if (!get_texture_for_framebuffer_err(ctx, texture, false, caller, &texObj)) return; if (texObj) { @@ -3385,7 +3395,7 @@ _mesa_FramebufferTextureLayer(GLenum target, GLenum attachment, } /* Get the texture object */ - if (!get_texture_for_framebuffer(ctx, texture, false, func, &texObj)) + if (!get_texture_for_framebuffer_err(ctx, texture, false, func, &texObj)) return; if (texObj) { @@ -3432,7 +3442,7 @@ _mesa_NamedFramebufferTextureLayer(GLuint framebuffer, GLenum attachment, return; /* Get the texture object */ - if (!get_texture_for_framebuffer(ctx, texture, false, func, &texObj)) + if (!get_texture_for_framebuffer_err(ctx, texture, false, func, &texObj)) return; if (texObj) { @@ -3489,7 +3499,7 @@ _mesa_FramebufferTexture(GLenum target, GLenum attachment, } /* Get the texture object */ - if (!get_texture_for_framebuffer(ctx, texture, true, func, &texObj)) + if (!get_texture_for_framebuffer_err(ctx, texture, true, func, &texObj)) return; if (texObj) { @@ -3533,7 +3543,7 @@ _mesa_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment, return; /* Get the texture object */ - if (!get_texture_for_framebuffer(ctx, texture, true, func, &texObj)) + if (!get_texture_for_framebuffer_err(ctx, texture, true, func, &texObj)) return; if (texObj) { |