[Mesa-dev] [PATCH] mesa: pass target through to driver when choosing texture format

Brian Paul brianp at vmware.com
Wed May 7 10:57:28 PDT 2014


On 05/06/2014 02:33 AM, Ilia Mirkin wrote:
> This only matters for TextureView where the texObj's target has not been
> set yet, in all other instances, texObj->target should be the same as
> the passed-in target parameter.
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>
> I ran into an assert in mesa/st when choosing the texture format because the
> target was 0. (While trying to implement texture views.) Not sure why it cares
> about the target, but this seems correct.
>
>   src/mesa/main/teximage.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index c7f301c..845ba80 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -3024,7 +3024,7 @@ _mesa_choose_texture_format(struct gl_context *ctx,
>      }
>
>      /* choose format from scratch */
> -   f = ctx->Driver.ChooseTextureFormat(ctx, texObj->Target, internalFormat,
> +   f = ctx->Driver.ChooseTextureFormat(ctx, target, internalFormat,
>                                          format, type);
>      ASSERT(f != MESA_FORMAT_NONE);
>      return f;
>

Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the mesa-dev mailing list