aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/a3xx
diff options
context:
space:
mode:
authorIlia Mirkin <[email protected]>2015-04-04 02:53:52 -0400
committerRob Clark <[email protected]>2015-04-05 16:36:35 -0400
commitb060b56772cdb349478757382de036a20a2402ba (patch)
tree4198b12da56eca39524a932dfcbea9949612a08f /src/gallium/drivers/freedreno/a3xx
parent1de72dfc8a2014069edd1b3d3d46dad478d0680a (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a3xx')
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_draw.c1
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_emit.h1
-rw-r--r--src/gallium/drivers/freedreno/a3xx/fd3_program.c3
3 files changed, 4 insertions, 1 deletions
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);