mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 23:00:11 +01:00
asahi: Make ctx->zs a pointer
When we save ZSA state with u_blitter, u_blitter just records the pointer for the state. It doesn't copy it. That requires an extra indirection on the context (as other drivers do) to fix restores of ZSA state with u_blitter. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18380>
This commit is contained in:
parent
968bbca578
commit
6b329b16f8
3 changed files with 8 additions and 10 deletions
|
|
@ -94,7 +94,7 @@ agx_blitter_save(struct agx_context *ctx, struct blitter_context *blitter,
|
|||
util_blitter_save_scissor(blitter, &ctx->scissor);
|
||||
util_blitter_save_fragment_shader(blitter, ctx->stage[PIPE_SHADER_FRAGMENT].shader);
|
||||
util_blitter_save_blend(blitter, ctx->blend);
|
||||
util_blitter_save_depth_stencil_alpha(blitter, &ctx->zs);
|
||||
util_blitter_save_depth_stencil_alpha(blitter, ctx->zs);
|
||||
util_blitter_save_stencil_ref(blitter, &ctx->stencil_ref);
|
||||
util_blitter_save_so_targets(blitter, 0, NULL);
|
||||
util_blitter_save_sample_mask(blitter, ctx->sample_mask, 0);
|
||||
|
|
|
|||
|
|
@ -253,9 +253,7 @@ static void
|
|||
agx_bind_zsa_state(struct pipe_context *pctx, void *cso)
|
||||
{
|
||||
struct agx_context *ctx = agx_context(pctx);
|
||||
|
||||
if (cso)
|
||||
memcpy(&ctx->zs, cso, sizeof(ctx->zs));
|
||||
ctx->zs = cso;
|
||||
}
|
||||
|
||||
static void *
|
||||
|
|
@ -1498,7 +1496,7 @@ demo_rasterizer(struct agx_context *ctx, struct agx_pool *pool, bool is_points)
|
|||
struct agx_rasterizer_packed out;
|
||||
|
||||
agx_pack(&out, RASTERIZER, cfg) {
|
||||
bool back_stencil = ctx->zs.base.stencil[1].enabled;
|
||||
bool back_stencil = ctx->zs->base.stencil[1].enabled;
|
||||
cfg.front.stencil_reference = ctx->stencil_ref.ref_value[0];
|
||||
cfg.back.stencil_reference = back_stencil ?
|
||||
ctx->stencil_ref.ref_value[1] :
|
||||
|
|
@ -1518,12 +1516,12 @@ demo_rasterizer(struct agx_context *ctx, struct agx_pool *pool, bool is_points)
|
|||
};
|
||||
|
||||
/* Words 2-3: front */
|
||||
out.opaque[2] |= ctx->zs.front.opaque[0];
|
||||
out.opaque[3] |= ctx->zs.front.opaque[1];
|
||||
out.opaque[2] |= ctx->zs->front.opaque[0];
|
||||
out.opaque[3] |= ctx->zs->front.opaque[1];
|
||||
|
||||
/* Words 4-5: back */
|
||||
out.opaque[4] |= ctx->zs.back.opaque[0];
|
||||
out.opaque[5] |= ctx->zs.back.opaque[1];
|
||||
out.opaque[4] |= ctx->zs->back.opaque[0];
|
||||
out.opaque[5] |= ctx->zs->back.opaque[1];
|
||||
|
||||
return agx_pool_upload_aligned(pool, &out, sizeof(out), 64);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ struct agx_context {
|
|||
struct agx_stage stage[PIPE_SHADER_TYPES];
|
||||
struct agx_attribute *attributes;
|
||||
struct agx_rasterizer *rast;
|
||||
struct agx_zsa zs;
|
||||
struct agx_zsa *zs;
|
||||
struct agx_blend *blend;
|
||||
struct pipe_blend_color blend_color;
|
||||
struct pipe_viewport_state viewport;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue