[Mesa-dev] [PATCH] mesa/st: remove _mesa_get_fallback_texture() calls
Brian Paul
brianp at vmware.com
Tue Apr 11 13:25:57 UTC 2017
Reviewed-by: Brian Paul <brianp at vmware.com>
On 04/10/2017 10:37 PM, Timothy Arceri wrote:
> These calls look like leftover from fallback texture support first
> being added to the st in 8f6d9e12be0be and then later being added
> to core mesa in 00e203fe17cbf21.
>
> The piglit test fp-incomplete-tex continues to work with this
> change.
> ---
> src/mesa/state_tracker/st_atom_sampler.c | 8 ++------
> src/mesa/state_tracker/st_atom_texture.c | 5 +----
> 2 files changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
> index 9ddc704..820a57d 100644
> --- a/src/mesa/state_tracker/st_atom_sampler.c
> +++ b/src/mesa/state_tracker/st_atom_sampler.c
> @@ -130,27 +130,23 @@ static void
> convert_sampler(struct st_context *st,
> struct pipe_sampler_state *sampler,
> GLuint texUnit)
> {
> const struct gl_texture_object *texobj;
> struct gl_context *ctx = st->ctx;
> const struct gl_sampler_object *msamp;
> GLenum texBaseFormat;
>
> texobj = ctx->Texture.Unit[texUnit]._Current;
> - if (!texobj) {
> - texobj = _mesa_get_fallback_texture(ctx, TEXTURE_2D_INDEX);
> - msamp = &texobj->Sampler;
> - } else {
> - msamp = _mesa_get_samplerobj(ctx, texUnit);
> - }
> + assert(texobj);
>
> + msamp = _mesa_get_samplerobj(ctx, texUnit);
> texBaseFormat = _mesa_texture_base_format(texobj);
>
> memset(sampler, 0, sizeof(*sampler));
> sampler->wrap_s = gl_wrap_xlate(msamp->WrapS);
> sampler->wrap_t = gl_wrap_xlate(msamp->WrapT);
> sampler->wrap_r = gl_wrap_xlate(msamp->WrapR);
>
> sampler->min_img_filter = gl_filter_to_img_filter(msamp->MinFilter);
> sampler->min_mip_filter = gl_filter_to_mip_filter(msamp->MinFilter);
> sampler->mag_img_filter = gl_filter_to_img_filter(msamp->MagFilter);
> diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
> index 5b481ec..fa4b644 100644
> --- a/src/mesa/state_tracker/st_atom_texture.c
> +++ b/src/mesa/state_tracker/st_atom_texture.c
> @@ -59,25 +59,22 @@ update_single_texture(struct st_context *st,
> {
> struct gl_context *ctx = st->ctx;
> const struct gl_sampler_object *samp;
> struct gl_texture_object *texObj;
> struct st_texture_object *stObj;
> GLboolean retval;
>
> samp = _mesa_get_samplerobj(ctx, texUnit);
>
> texObj = ctx->Texture.Unit[texUnit]._Current;
> + assert(texObj);
>
> - if (!texObj) {
> - texObj = _mesa_get_fallback_texture(ctx, TEXTURE_2D_INDEX);
> - samp = &texObj->Sampler;
> - }
> stObj = st_texture_object(texObj);
>
> retval = st_finalize_texture(ctx, st->pipe, texObj, 0);
> if (!retval) {
> /* out of mem */
> return GL_FALSE;
> }
>
> /* Check a few pieces of state outside the texture object to see if we
> * need to force revalidation.
>
More information about the mesa-dev
mailing list