[Mesa-dev] [PATCH 09/14] mesa/main/ff_frag: Don't retrieve format if not necessary.

Marek Olšák maraeo at gmail.com
Wed Apr 5 19:50:14 UTC 2017


For patches 1-9:

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

I'll look at the rest later.

Marek

On Thu, Mar 30, 2017 at 8:09 PM, Gustaw Smolarczyk <wielkiegie at gmail.com> wrote:
> Signed-off-by: Gustaw Smolarczyk <wielkiegie at gmail.com>
> ---
>  src/mesa/main/ff_fragment_shader.cpp | 15 ++++++---------
>  1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/src/mesa/main/ff_fragment_shader.cpp b/src/mesa/main/ff_fragment_shader.cpp
> index 2b4d99c879..e1fe9b58c0 100644
> --- a/src/mesa/main/ff_fragment_shader.cpp
> +++ b/src/mesa/main/ff_fragment_shader.cpp
> @@ -402,24 +402,21 @@ static GLuint make_state_key( struct gl_context *ctx,  struct state_key *key )
>        const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
>        const struct gl_texture_object *texObj = texUnit->_Current;
>        const struct gl_tex_env_combine_state *comb = texUnit->_CurrentCombine;
> -      const struct gl_sampler_object *samp;
> -      GLenum format;
>
>        if (!texObj)
>           continue;
>
> -      samp = _mesa_get_samplerobj(ctx, i);
> -      format = _mesa_texture_base_format(texObj);
> -
>        key->unit[i].enabled = 1;
>        inputs_referenced |= VARYING_BIT_TEX(i);
>
>        key->unit[i].source_index = texObj->TargetIndex;
>
> -      key->unit[i].shadow =
> -         ((samp->CompareMode == GL_COMPARE_R_TO_TEXTURE) &&
> -          ((format == GL_DEPTH_COMPONENT) ||
> -           (format == GL_DEPTH_STENCIL_EXT)));
> +      const struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, i);
> +      if (samp->CompareMode == GL_COMPARE_R_TO_TEXTURE) {
> +         const GLenum format = _mesa_texture_base_format(texObj);
> +         key->unit[i].shadow = (format == GL_DEPTH_COMPONENT ||
> +                               format == GL_DEPTH_STENCIL_EXT);
> +      }
>
>        key->unit[i].NumArgsRGB = comb->_NumArgsRGB;
>        key->unit[i].NumArgsA = comb->_NumArgsA;
> --
> 2.12.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list