From fe6fc579cbdc040a9bd62170c3713546dd112ae5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 25 Oct 2017 12:51:04 -0700 Subject: [PATCH] broadcom/vc5: Use the sampler view's format, not the resource's. This should help with texture views, though I just noticed this while reading the code. --- src/gallium/drivers/vc5/vc5_resource.c | 5 ----- src/gallium/drivers/vc5/vc5_resource.h | 2 -- src/gallium/drivers/vc5/vc5_state.c | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/gallium/drivers/vc5/vc5_resource.c b/src/gallium/drivers/vc5/vc5_resource.c index e1ed46039a1..29623d9ba2c 100644 --- a/src/gallium/drivers/vc5/vc5_resource.c +++ b/src/gallium/drivers/vc5/vc5_resource.c @@ -574,9 +574,6 @@ vc5_resource_create_with_modifiers(struct pipe_screen *pscreen, return NULL; } - if (tmpl->target != PIPE_BUFFER) - rsc->tex_format = vc5_get_tex_format(prsc->format); - vc5_setup_slices(rsc, "create"); if (!vc5_resource_bo_alloc(rsc)) goto fail; @@ -649,8 +646,6 @@ vc5_resource_from_handle(struct pipe_screen *pscreen, vc5_setup_slices(rsc, "import"); - rsc->tex_format = vc5_get_tex_format(prsc->format); - DBG(V3D_DEBUG_SURFACE, "rsc import %p (format %s), %dx%d: " "level 0 (R) -> stride %d@0x%08x\n", diff --git a/src/gallium/drivers/vc5/vc5_resource.h b/src/gallium/drivers/vc5/vc5_resource.h index e65cb8c8fee..7d473679ebe 100644 --- a/src/gallium/drivers/vc5/vc5_resource.h +++ b/src/gallium/drivers/vc5/vc5_resource.h @@ -109,8 +109,6 @@ struct vc5_resource { uint32_t cube_map_stride; int cpp; bool tiled; - /** One of V3D_TEXTURE_DATA_FORMAT_* */ - uint8_t tex_format; /** * Number of times the resource has been written to. diff --git a/src/gallium/drivers/vc5/vc5_state.c b/src/gallium/drivers/vc5/vc5_state.c index 817b6247d58..1f05576c18b 100644 --- a/src/gallium/drivers/vc5/vc5_state.c +++ b/src/gallium/drivers/vc5/vc5_state.c @@ -571,7 +571,7 @@ vc5_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *prsc, .image_height = prsc->height0 * msaa_scale, .image_depth = prsc->depth0, - .texture_type = rsc->tex_format, + .texture_type = vc5_get_tex_format(cso->format), .srgb = util_format_is_srgb(cso->format), .base_level = cso->u.tex.first_level, -- 2.11.0