[Mesa-dev] [PATCH 1/2] st/mesa: pass correct pipe_texture_target to st_choose_format()

Jakob Bornecrantz wallbraker at gmail.com
Mon Nov 18 14:59:54 PST 2013


Good catch, both patches in the series are
Reviewed-by: Jakob Bornecrantz <jakob at vmware.com>

Cheers, Jakob.

On Mon, Nov 18, 2013 at 11:55 PM, Brian Paul <brianp at vmware.com> wrote:
> We were always passing PIPE_TEXTURE_2D, but not all formats are
> supported for all types of textures.  In particular, the driver may
> not supported texture compression for all types of textures.
> ---
>  src/mesa/state_tracker/st_format.c |    6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
> index 33c2ca6..ec25523 100644
> --- a/src/mesa/state_tracker/st_format.c
> +++ b/src/mesa/state_tracker/st_format.c
> @@ -45,6 +45,7 @@
>  #include "pipe/p_defines.h"
>  #include "pipe/p_screen.h"
>  #include "util/u_format.h"
> +#include "st_cb_texture.h"
>  #include "st_context.h"
>  #include "st_format.h"
>
> @@ -1726,6 +1727,7 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
>     struct st_context *st = st_context(ctx);
>     enum pipe_format pFormat;
>     unsigned bindings;
> +   enum pipe_texture_target pTarget = gl_target_to_pipe(target);
>
>     if (target == GL_TEXTURE_1D || target == GL_TEXTURE_1D_ARRAY) {
>        /* We don't do compression for these texture targets because of
> @@ -1782,12 +1784,12 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
>     }
>
>     pFormat = st_choose_format(st, internalFormat, format, type,
> -                              PIPE_TEXTURE_2D, 0, bindings, ctx->Mesa_DXTn);
> +                              pTarget, 0, bindings, ctx->Mesa_DXTn);
>
>     if (pFormat == PIPE_FORMAT_NONE) {
>        /* try choosing format again, this time without render target bindings */
>        pFormat = st_choose_format(st, internalFormat, format, type,
> -                                 PIPE_TEXTURE_2D, 0, PIPE_BIND_SAMPLER_VIEW,
> +                                 pTarget, 0, PIPE_BIND_SAMPLER_VIEW,
>                                   ctx->Mesa_DXTn);
>     }
>
> --
> 1.7.10.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list