fd2_emit_vertex_bufs(ctx->ring, 0x78, bufs, vtx->num_elements);
}
-static void
+static bool
fd2_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
{
struct fd_ringbuffer *ring = ctx->ring;
OUT_RING(ring, 0x00000000);
emit_cacheflush(ring);
+
+ return true;
}
const struct pipe_draw_info *info = emit->info;
enum pc_di_primtype primtype = ctx->primtypes[info->mode];
- if (!(fd3_emit_get_vp(emit) && fd3_emit_get_fp(emit)))
- return;
-
fd3_emit_state(ctx, ring, emit);
if (emit->dirty & (FD_DIRTY_VTXBUF | FD_DIRTY_VTXSTATE))
}
}
-static void
+static bool
fd3_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
{
struct fd3_context *fd3_ctx = fd3_context(ctx);
.prog = &ctx->prog,
.info = info,
.key = {
- /* 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,
.sprite_coord_enable = ctx->rasterizer->sprite_coord_enable,
.sprite_coord_mode = ctx->rasterizer->sprite_coord_mode,
};
- unsigned dirty;
fixup_shader_state(ctx, &emit.key);
- dirty = ctx->dirty;
- emit.dirty = dirty & ~(FD_DIRTY_BLEND);
- draw_impl(ctx, ctx->binning_ring, &emit);
+ unsigned dirty = ctx->dirty;
+
+ /* do regular pass first, since that is more likely to fail compiling: */
+
+ if (!(fd3_emit_get_vp(&emit) && fd3_emit_get_fp(&emit)))
+ return false;
- /* and now regular (non-binning) pass: */
emit.key.binning_pass = false;
emit.dirty = dirty;
+ draw_impl(ctx, ctx->ring, &emit);
+
+ /* and now binning pass: */
+ emit.key.binning_pass = true;
+ emit.dirty = dirty & ~(FD_DIRTY_BLEND);
emit.vp = NULL; /* we changed key so need to refetch vp */
emit.fp = NULL;
- draw_impl(ctx, ctx->ring, &emit);
+ draw_impl(ctx, ctx->binning_ring, &emit);
+
+ return true;
}
/* clear operations ignore viewport state, so we need to reset it
const struct pipe_draw_info *info = emit->info;
enum pc_di_primtype primtype = ctx->primtypes[info->mode];
- if (!(fd4_emit_get_vp(emit) && fd4_emit_get_fp(emit)))
- return;
-
fd4_emit_state(ctx, ring, emit);
if (emit->dirty & (FD_DIRTY_VTXBUF | FD_DIRTY_VTXSTATE))
}
}
-static void
+static bool
fd4_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info)
{
struct fd4_context *fd4_ctx = fd4_context(ctx);
.prog = &ctx->prog,
.info = info,
.key = {
- /* 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,
.sprite_coord_enable = ctx->rasterizer->sprite_coord_enable,
.sprite_coord_mode = ctx->rasterizer->sprite_coord_mode,
};
- unsigned dirty;
fixup_shader_state(ctx, &emit.key);
- dirty = ctx->dirty;
- emit.dirty = dirty & ~(FD_DIRTY_BLEND);
- draw_impl(ctx, ctx->binning_ring, &emit);
+ unsigned dirty = ctx->dirty;
+
+ /* do regular pass first, since that is more likely to fail compiling: */
+
+ if (!(fd4_emit_get_vp(&emit) && fd4_emit_get_fp(&emit)))
+ return false;
- /* and now regular (non-binning) pass: */
emit.key.binning_pass = false;
emit.dirty = dirty;
- emit.vp = NULL; /* we changed key so need to refetch vp */
- emit.fp = NULL;
if (ctx->rasterizer->rasterizer_discard) {
fd_wfi(ctx, ctx->ring);
OUT_RING(ctx->ring, ~A4XX_RB_RENDER_CONTROL_DISABLE_COLOR_PIPE);
OUT_RING(ctx->ring, 0);
}
+
+ /* and now binning pass: */
+ emit.key.binning_pass = true;
+ emit.dirty = dirty & ~(FD_DIRTY_BLEND);
+ emit.vp = NULL; /* we changed key so need to refetch vp */
+ emit.fp = NULL;
+ draw_impl(ctx, ctx->binning_ring, &emit);
+
+ return true;
}
/* clear operations ignore viewport state, so we need to reset it
void (*emit_sysmem_prep)(struct fd_context *ctx);
/* draw: */
- void (*draw_vbo)(struct fd_context *ctx, const struct pipe_draw_info *info);
+ bool (*draw_vbo)(struct fd_context *ctx, const struct pipe_draw_info *info);
void (*clear)(struct fd_context *ctx, unsigned buffers,
const union pipe_color_union *color, double depth, unsigned stencil);
return;
}
- ctx->needs_flush = true;
-
/*
* Figure out the buffers/features we need:
*/
util_format_short_name(pipe_surface_format(pfb->zsbuf)));
fd_hw_query_set_stage(ctx, ctx->ring, FD_STAGE_DRAW);
- ctx->draw_vbo(ctx, info);
+ if (ctx->draw_vbo(ctx, info))
+ ctx->needs_flush = true;
for (i = 0; i < ctx->streamout.num_targets; i++)
ctx->streamout.offsets[i] += info->count;