freedreno/a4xx: add debug callback to emit
[mesa.git] / src / gallium / drivers / freedreno / a4xx / fd4_draw.c
index 68e1f53e2dde9e7d9dbdf9c1e4f725ce8c8c14b1..d49c529aab4d11a54b7f63bf2782ac4d827c679b 100644 (file)
@@ -104,6 +104,12 @@ fixup_shader_state(struct fd_context *ctx, struct ir3_shader_key *key)
                                ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
                }
 
+               if (last_key->vclamp_color != key->vclamp_color)
+                       ctx->prog.dirty |= FD_SHADER_DIRTY_VP;
+
+               if (last_key->fclamp_color != key->fclamp_color)
+                       ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
+
                if (last_key->color_two_side != key->color_two_side)
                        ctx->prog.dirty |= FD_SHADER_DIRTY_FP;
 
@@ -122,6 +128,7 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
 {
        struct fd4_context *fd4_ctx = fd4_context(ctx);
        struct fd4_emit emit = {
+               .debug = &ctx->debug,
                .vtx  = &ctx->vtx,
                .prog = &ctx->prog,
                .info = info,
@@ -129,6 +136,8 @@ fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
                        /* do binning pass first: */
                        .binning_pass = true,
                        .color_two_side = ctx->rasterizer->light_twoside,
+                       .vclamp_color = ctx->rasterizer->clamp_vertex_color,
+                       .fclamp_color = ctx->rasterizer->clamp_fragment_color,
                        .rasterflat = ctx->rasterizer->flatshade,
                        // TODO set .half_precision based on render target format,
                        // ie. float16 and smaller use half, float32 use full..
@@ -209,6 +218,7 @@ fd4_clear_binning(struct fd_context *ctx, unsigned dirty)
        struct fd4_context *fd4_ctx = fd4_context(ctx);
        struct fd_ringbuffer *ring = ctx->binning_ring;
        struct fd4_emit emit = {
+               .debug = &ctx->debug,
                .vtx  = &fd4_ctx->solid_vbuf_state,
                .prog = &ctx->solid_prog,
                .key = {
@@ -246,6 +256,7 @@ fd4_clear(struct fd_context *ctx, unsigned buffers,
        unsigned dirty = ctx->dirty;
        unsigned i;
        struct fd4_emit emit = {
+               .debug = &ctx->debug,
                .vtx  = &fd4_ctx->solid_vbuf_state,
                .prog = &ctx->solid_prog,
                .key = {