diff options
author | Rob Clark <[email protected]> | 2016-05-03 18:36:52 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-05-04 11:25:55 -0400 |
commit | 2e117a7649c1972cf36ec874d852a3e85d4750fa (patch) | |
tree | 2620f054edc992bcda3de08a00781129dbe40122 /src/gallium/drivers/freedreno/a3xx | |
parent | 291ac872a445f3edebd668b27e910a79e1de5a00 (diff) |
freedreno: allow ctx->draw_vbo to fail
Pretty much only happens if shader variant compile fails. But in this
case, if we haven't emitted cmdstream, we don't want to set needs_flush.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a3xx')
-rw-r--r-- | src/gallium/drivers/freedreno/a3xx/fd3_draw.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/gallium/drivers/freedreno/a3xx/fd3_draw.c b/src/gallium/drivers/freedreno/a3xx/fd3_draw.c index dc4558e9644..67239414393 100644 --- a/src/gallium/drivers/freedreno/a3xx/fd3_draw.c +++ b/src/gallium/drivers/freedreno/a3xx/fd3_draw.c @@ -60,9 +60,6 @@ draw_impl(struct fd_context *ctx, struct fd_ringbuffer *ring, 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)) @@ -132,7 +129,7 @@ fixup_shader_state(struct fd_context *ctx, struct ir3_shader_key *key) } } -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); @@ -142,8 +139,6 @@ fd3_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info) .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, @@ -162,20 +157,28 @@ fd3_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info) .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 |