emit_cacheflush(ring);
+ fd_context_all_clean(ctx);
+
return true;
}
}
void
-fd2_emit_state(struct fd_context *ctx, uint32_t dirty)
+fd2_emit_state(struct fd_context *ctx, const uint32_t dirty)
{
struct fd2_blend_stateobj *blend = fd2_blend_stateobj(ctx->blend);
struct fd2_zsa_stateobj *zsa = fd2_zsa_stateobj(ctx->zsa);
if (dirty & (FD_DIRTY_VERTTEX | FD_DIRTY_FRAGTEX | FD_DIRTY_PROG))
emit_textures(ring, ctx);
-
- ctx->dirty &= ~dirty;
}
/* emit per-context initialization:
emit.fp = NULL;
draw_impl(ctx, ctx->batch->binning, &emit);
+ fd_context_all_clean(ctx);
+
return true;
}
{
const struct ir3_shader_variant *vp = fd3_emit_get_vp(emit);
const struct ir3_shader_variant *fp = fd3_emit_get_fp(emit);
- uint32_t dirty = emit->dirty;
+ const uint32_t dirty = emit->dirty;
emit_marker(ring, 5);
if (dirty & (FD_DIRTY_VERTTEX | FD_DIRTY_FRAGTEX))
fd_wfi(ctx->batch, ring);
- if (dirty & FD_DIRTY_VERTTEX) {
- if (vp->has_samp)
- emit_textures(ctx, ring, SB_VERT_TEX, &ctx->tex[PIPE_SHADER_VERTEX]);
- else
- dirty &= ~FD_DIRTY_VERTTEX;
- }
-
- if (dirty & FD_DIRTY_FRAGTEX) {
- if (fp->has_samp)
- emit_textures(ctx, ring, SB_FRAG_TEX, &ctx->tex[PIPE_SHADER_FRAGMENT]);
- else
- dirty &= ~FD_DIRTY_FRAGTEX;
- }
+ if (dirty & FD_DIRTY_VERTTEX)
+ emit_textures(ctx, ring, SB_VERT_TEX, &ctx->tex[PIPE_SHADER_VERTEX]);
- ctx->dirty &= ~dirty;
+ if (dirty & FD_DIRTY_FRAGTEX)
+ emit_textures(ctx, ring, SB_FRAG_TEX, &ctx->tex[PIPE_SHADER_FRAGMENT]);
}
/* emit setup at begin of new cmdstream buffer (don't rely on previous
emit.fp = NULL;
draw_impl(ctx, ctx->batch->binning, &emit);
+ fd_context_all_clean(ctx);
+
return true;
}
{
const struct ir3_shader_variant *vp = fd4_emit_get_vp(emit);
const struct ir3_shader_variant *fp = fd4_emit_get_fp(emit);
- uint32_t dirty = emit->dirty;
+ const uint32_t dirty = emit->dirty;
emit_marker(ring, 5);
OUT_RING(ring, A4XX_RB_BLEND_ALPHA_F32(bcolor->color[3]));
}
- if (dirty & FD_DIRTY_VERTTEX) {
- if (vp->has_samp)
- emit_textures(ctx, ring, SB4_VS_TEX, &ctx->tex[PIPE_SHADER_VERTEX], vp);
- else
- dirty &= ~FD_DIRTY_VERTTEX;
- }
-
- if (dirty & FD_DIRTY_FRAGTEX) {
- if (fp->has_samp)
- emit_textures(ctx, ring, SB4_FS_TEX, &ctx->tex[PIPE_SHADER_FRAGMENT], fp);
- else
- dirty &= ~FD_DIRTY_FRAGTEX;
- }
+ if (dirty & FD_DIRTY_VERTTEX)
+ emit_textures(ctx, ring, SB4_VS_TEX, &ctx->tex[PIPE_SHADER_VERTEX], vp);
- ctx->dirty &= ~dirty;
+ if (dirty & FD_DIRTY_FRAGTEX)
+ emit_textures(ctx, ring, SB4_FS_TEX, &ctx->tex[PIPE_SHADER_FRAGMENT], fp);
}
/* emit setup at begin of new cmdstream buffer (don't rely on previous
}
}
+ fd_context_all_clean(ctx);
+
return true;
}
{
const struct ir3_shader_variant *vp = fd5_emit_get_vp(emit);
const struct ir3_shader_variant *fp = fd5_emit_get_fp(emit);
- uint32_t dirty = emit->dirty;
+ const uint32_t dirty = emit->dirty;
bool needs_border = false;
emit_marker5(ring, 5);
}
if (dirty & FD_DIRTY_VERTTEX) {
- if (vp->has_samp) {
- needs_border |= emit_textures(ctx, ring, SB4_VS_TEX,
- &ctx->tex[PIPE_SHADER_VERTEX]);
- OUT_PKT4(ring, REG_A5XX_TPL1_VS_TEX_COUNT, 1);
- OUT_RING(ring, ctx->tex[PIPE_SHADER_VERTEX].num_textures);
- } else {
- dirty &= ~FD_DIRTY_VERTTEX;
- }
+ needs_border |= emit_textures(ctx, ring, SB4_VS_TEX,
+ &ctx->tex[PIPE_SHADER_VERTEX]);
+ OUT_PKT4(ring, REG_A5XX_TPL1_VS_TEX_COUNT, 1);
+ OUT_RING(ring, ctx->tex[PIPE_SHADER_VERTEX].num_textures);
}
if (dirty & FD_DIRTY_FRAGTEX) {
- if (fp->has_samp) {
- needs_border |= emit_textures(ctx, ring, SB4_FS_TEX,
- &ctx->tex[PIPE_SHADER_FRAGMENT]);
- OUT_PKT4(ring, REG_A5XX_TPL1_FS_TEX_COUNT, 1);
- OUT_RING(ring, ctx->tex[PIPE_SHADER_FRAGMENT].num_textures);
- } else {
- dirty &= ~FD_DIRTY_FRAGTEX;
- }
+ needs_border |= emit_textures(ctx, ring, SB4_FS_TEX,
+ &ctx->tex[PIPE_SHADER_FRAGMENT]);
+ OUT_PKT4(ring, REG_A5XX_TPL1_FS_TEX_COUNT, 1);
+ OUT_RING(ring, ctx->tex[PIPE_SHADER_FRAGMENT].num_textures);
}
if (needs_border)
emit_border_color(ctx, ring);
-
- ctx->dirty &= ~dirty;
}
/* emit setup at begin of new cmdstream buffer (don't rely on previous
ctx->dirty = ~0;
}
+static inline void
+fd_context_all_clean(struct fd_context *ctx)
+{
+ ctx->dirty = 0;
+}
+
static inline struct pipe_scissor_state *
fd_context_get_scissor(struct fd_context *ctx)
{