freedreno/a3xx: pass sprite coord mode through to program emit
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 4 Apr 2015 06:53:52 +0000 (02:53 -0400)
committerRob Clark <robclark@freedesktop.org>
Sun, 5 Apr 2015 20:36:35 +0000 (16:36 -0400)
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>
src/gallium/drivers/freedreno/a3xx/fd3_draw.c
src/gallium/drivers/freedreno/a3xx/fd3_emit.h
src/gallium/drivers/freedreno/a3xx/fd3_program.c

index 044355c2b6838bdcd4107df8741c7b4fa669a89c..b522cf8669537a1f99430818789bf3fa57adb159 100644 (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;
 
index a438ddaee8523308387951a68a84d03f30a5ccc5..8f21919c9a7693c548946bbb3c66428c25963383 100644 (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: */
index 4581a6b7af919911d8e3eb0e5115fe474920a048..a6824ef92e7719b04f2d9ea90481c80778d187c9 100644 (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);