freedreno: a2xx: cleanup init_shader_const
authorJonathan Marek <jonathan@marek.ca>
Wed, 16 Jan 2019 21:06:11 +0000 (16:06 -0500)
committerRob Clark <robdclark@gmail.com>
Mon, 21 Jan 2019 14:21:51 +0000 (09:21 -0500)
Only 3 vertices are used so we can drop the data for vertex 4

It doesn't make sense to have 1.1 for some coordinates, use 1.0 instead

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a2xx/fd2_context.c
src/gallium/drivers/freedreno/a2xx/fd2_draw.c
src/gallium/drivers/freedreno/a2xx/fd2_gmem.c

index 081b0119cb53de039dfcc74d8ef6a7adac443026..760ad17732a6c876f068b0aad9ecd7b0e18ec89c 100644 (file)
@@ -46,17 +46,14 @@ static struct pipe_resource *
 create_solid_vertexbuf(struct pipe_context *pctx)
 {
        static const float init_shader_const[] = {
-                       /* for clear/gmem2mem: */
-                       -1.000000, +1.000000, +1.000000, +1.100000,
-                       +1.000000, +1.000000, -1.000000, -1.100000,
-                       +1.000000, +1.100000, -1.100000, +1.000000,
-                       /* for mem2gmem: (vertices) */
-                       -1.000000, +1.000000, +1.000000, +1.000000,
-                       +1.000000, +1.000000, -1.000000, -1.000000,
-                       +1.000000, +1.000000, -1.000000, +1.000000,
+                       /* for clear/gmem2mem/mem2gmem (vertices): */
+                       -1.000000, +1.000000, +1.000000,
+                       +1.000000, +1.000000, +1.000000,
+                       -1.000000, -1.000000, +1.000000,
                        /* for mem2gmem: (tex coords) */
-                       +0.000000, +0.000000, +1.000000, +0.000000,
-                       +0.000000, +1.000000, +1.000000, +1.000000,
+                       +0.000000, +0.000000,
+                       +1.000000, +0.000000,
+                       +0.000000, +1.000000,
        };
        struct pipe_resource *prsc = pipe_buffer_create(pctx->screen,
                        PIPE_BIND_CUSTOM, PIPE_USAGE_IMMUTABLE, sizeof(init_shader_const));
index 6dac8ca6a9d4b898520ebb19944a7c84bc291e99..81137705180ff8390276c072c3f1597a1c1a036b 100644 (file)
@@ -207,7 +207,7 @@ fd2_clear(struct fd_context *ctx, unsigned buffers,
                                        FD_DIRTY_FRAMEBUFFER | FD_DIRTY_SCISSOR));
 
        fd2_emit_vertex_bufs(ring, 0x9c, (struct fd2_vertex_buf[]) {
-                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 48 },
+                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 36 },
                }, 1);
 
        OUT_PKT3(ring, CP_SET_CONSTANT, 2);
index e98ae7334ace4fb462f5b492942082d3e9327218..263e9d77eb0d0964a81040c1b7d7f01ca6f716fc 100644 (file)
@@ -120,7 +120,7 @@ fd2_emit_tile_gmem2mem(struct fd_batch *batch, struct fd_tile *tile)
        struct pipe_framebuffer_state *pfb = &batch->framebuffer;
 
        fd2_emit_vertex_bufs(ring, 0x9c, (struct fd2_vertex_buf[]) {
-                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 48 },
+                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 36 },
                }, 1);
 
        OUT_PKT3(ring, CP_SET_CONSTANT, 2);
@@ -254,8 +254,8 @@ fd2_emit_tile_mem2gmem(struct fd_batch *batch, struct fd_tile *tile)
        float x0, y0, x1, y1;
 
        fd2_emit_vertex_bufs(ring, 0x9c, (struct fd2_vertex_buf[]) {
-                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 48, .offset = 0x30 },
-                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 32, .offset = 0x60 },
+                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 36, },
+                       { .prsc = fd2_ctx->solid_vertexbuf, .size = 24, .offset = 36 },
                }, 2);
 
        /* write texture coordinates to vertexbuf: */