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 <imirkin@alum.mit.edu>
This commit is contained in:
Ilia Mirkin 2015-04-04 02:53:52 -04:00 committed by Rob Clark
parent 1de72dfc8a
commit b060b56772
3 changed files with 4 additions and 1 deletions

View File

@ -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;

View File

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

View File

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