broadcom/vc5: Use the sampler view's format, not the resource's.
authorEric Anholt <eric@anholt.net>
Wed, 25 Oct 2017 19:51:04 +0000 (12:51 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 30 Oct 2017 20:31:27 +0000 (13:31 -0700)
This should help with texture views, though I just noticed this while
reading the code.

src/gallium/drivers/vc5/vc5_resource.c
src/gallium/drivers/vc5/vc5_resource.h
src/gallium/drivers/vc5/vc5_state.c

index e1ed46039a17ec7fe553eb100c50dba6ebc42b11..29623d9ba2cecde3bfbc0eefae68cd4624e90ef7 100644 (file)
@@ -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",
index e65cb8c8fee4c339da346bd0fa72e5def88481d4..7d473679ebe7d821ce76ec7e0ea851e56f611072 100644 (file)
@@ -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.
index 817b6247d580dd618a03429c223d2c91643b815b..1f05576c18ba3987255784cdd1083ceeb7e53d97 100644 (file)
@@ -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,