panfrost: Drop initial mali_attr_meta.src_offset assignment
authorBoris Brezillon <boris.brezillon@collabora.com>
Thu, 5 Mar 2020 18:22:26 +0000 (19:22 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Tue, 10 Mar 2020 11:47:34 +0000 (12:47 +0100)
The mali_attr_meta.src_offset is initialized to
pipe_vertex_element.src_offset at vertex element creation time, but
this field is then adjusted when the descrptors are emitted. Let's
use the pipe_vertex_element data we saved earlier and drop this initial
assignment.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4083>

src/gallium/drivers/panfrost/pan_context.c

index 528ae2e62828b42d37116f4ff297417dba8f17f6..0a010b99fc4e59064530607cc4e387dec0b322f2 100644 (file)
@@ -232,7 +232,7 @@ panfrost_stage_attributes(struct panfrost_context *ctx)
                  * read src_offset from so->hw (which is not GPU visible)
                  * rather than target (which is) due to caching effects */
 
-                unsigned src_offset = so->hw[i].src_offset;
+                unsigned src_offset = so->pipe[i].src_offset;
                 src_offset += (addr & 63);
 
                 /* Also, somewhat obscurely per-instance data needs to be
@@ -722,9 +722,6 @@ panfrost_create_vertex_elements_state(
                 so->hw[i].swizzle = panfrost_get_default_swizzle(desc->nr_channels);
 
                 so->hw[i].format = panfrost_find_format(desc);
-
-                /* The field itself should probably be shifted over */
-                so->hw[i].src_offset = elements[i].src_offset;
         }
 
         return so;