OSDN Git Service

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 044355c..b522cf8 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 a438dda..8f21919 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 4581a6b..a6824ef 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);