From b060b56772cdb349478757382de036a20a2402ba Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sat, 4 Apr 2015 02:53:52 -0400 Subject: freedreno/a3xx: pass sprite coord mode through to program emit Use the correct sprite replacement depending on the flip of the coord mode, using either T or 1-T depending on whether we have an upper-left or lower-left coordinate origin. This fixes all the point sprite piglits. Signed-off-by: Ilia Mirkin --- src/gallium/drivers/freedreno/a3xx/fd3_draw.c | 1 + src/gallium/drivers/freedreno/a3xx/fd3_emit.h | 1 + src/gallium/drivers/freedreno/a3xx/fd3_program.c | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_draw.c b/src/gallium/drivers/freedreno/a3xx/fd3_draw.c index 044355c2b68..b522cf86695 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_draw.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_draw.c @@ -153,6 +153,7 @@ fd3_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info) }, .rasterflat = ctx->rasterizer && ctx->rasterizer->flatshade, .sprite_coord_enable = ctx->rasterizer ? ctx->rasterizer->sprite_coord_enable : 0, + .sprite_coord_mode = ctx->rasterizer ? ctx->rasterizer->sprite_coord_mode : false, }; unsigned dirty; diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_emit.h b/src/gallium/drivers/freedreno/a3xx/fd3_emit.h index a438ddaee85..8f21919c9a7 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_emit.h +++ b/src/gallium/drivers/freedreno/a3xx/fd3_emit.h @@ -56,6 +56,7 @@ struct fd3_emit { uint32_t dirty; uint32_t sprite_coord_enable; + bool sprite_coord_mode; bool rasterflat; /* cached to avoid repeated lookups of same variants: */ diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_program.c b/src/gallium/drivers/freedreno/a3xx/fd3_program.c index 4581a6b7af9..a6824ef92e7 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_program.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_program.c @@ -417,7 +417,8 @@ fd3_program_emit(struct fd_ringbuffer *ring, struct fd3_emit *emit, * 1's for the .z and .w components. */ if (emit->sprite_coord_enable & (1 << sem2idx(fp->inputs[j].semantic))) - vpsrepl[inloc / 16] |= 0x09 << ((inloc % 16) * 2); + vpsrepl[inloc / 16] |= (emit->sprite_coord_mode ? 0x0d : 0x09) + << ((inloc % 16) * 2); } OUT_PKT0(ring, REG_A3XX_VPC_ATTR, 2); -- cgit v1.2.3