From fbd9cc61694dcb59b3d2a742073ed231f848702d Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 11 Jun 2017 01:41:40 +0200 Subject: st/mesa: don't return an error from update_single_texture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It can just return a NULL sampler view, which is better than not doing anything at all. Reviewed-by: Nicolai Hähnle --- src/mesa/state_tracker/st_atom_texture.c | 13 ++++--------- src/mesa/state_tracker/st_texture.c | 3 ++- src/mesa/state_tracker/st_texture.h | 2 +- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 70c32e4e07d..20cc859c941 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -55,7 +55,7 @@ /** * Get a pipe_sampler_view object from a texture unit. */ -GLboolean +void st_update_single_texture(struct st_context *st, struct pipe_sampler_view **sampler_view, GLuint texUnit, unsigned glsl_version) @@ -76,7 +76,8 @@ st_update_single_texture(struct st_context *st, retval = st_finalize_texture(ctx, st->pipe, texObj, 0); if (!retval) { /* out of mem */ - return GL_FALSE; + *sampler_view = NULL; + return; } /* Check a few pieces of state outside the texture object to see if we @@ -97,7 +98,6 @@ st_update_single_texture(struct st_context *st, *sampler_view = st_get_texture_sampler_view_from_stobj(st, stObj, samp, glsl_version); - return GL_TRUE; } @@ -129,13 +129,8 @@ update_textures(struct st_context *st, /* prog->sh.data is NULL if it's ARB_fragment_program */ unsigned glsl_version = prog->sh.data ? prog->sh.data->Version : 0; const GLuint texUnit = prog->SamplerUnits[unit]; - GLboolean retval; - - retval = st_update_single_texture(st, &sampler_view, texUnit, - glsl_version); - if (retval == GL_FALSE) - continue; + st_update_single_texture(st, &sampler_view, texUnit, glsl_version); num_textures = unit + 1; } diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index cf8fe225a2d..2b43cecc521 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -512,7 +512,8 @@ st_create_texture_handle_from_unit(struct st_context *st, struct pipe_sampler_view *view; struct pipe_sampler_state sampler = {0}; - if (!st_update_single_texture(st, &view, texUnit, prog->sh.data->Version)) + st_update_single_texture(st, &view, texUnit, prog->sh.data->Version); + if (!view) return 0; if (view->target != PIPE_BUFFER) diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h index 450d940e76e..b9336544bb3 100644 --- a/src/mesa/state_tracker/st_texture.h +++ b/src/mesa/state_tracker/st_texture.h @@ -288,7 +288,7 @@ st_convert_sampler_from_unit(const struct st_context *st, struct pipe_sampler_state *sampler, GLuint texUnit); -GLboolean +void st_update_single_texture(struct st_context *st, struct pipe_sampler_view **sampler_view, GLuint texUnit, unsigned glsl_version); -- cgit v1.2.3