freedreno: a2xx: cleanup init_shader_const

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>
This commit is contained in:
Jonathan Marek 2019-01-16 16:06:11 -05:00 committed by Rob Clark
parent 0a793c78a3
commit 6ef7700ac6
3 changed files with 11 additions and 14 deletions

View 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));

View 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);

View 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: */