diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c index 07bed069935..88a3d1f2a33 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.c +++ b/src/gallium/auxiliary/cso_cache/cso_context.c @@ -849,10 +849,10 @@ cso_restore_min_samples(struct cso_context *ctx) } void cso_set_stencil_ref(struct cso_context *ctx, - const struct pipe_stencil_ref *sr) + const struct pipe_stencil_ref sr) { - if (memcmp(&ctx->stencil_ref, sr, sizeof(ctx->stencil_ref))) { - ctx->stencil_ref = *sr; + if (memcmp(&ctx->stencil_ref, &sr, sizeof(ctx->stencil_ref))) { + ctx->stencil_ref = sr; ctx->pipe->set_stencil_ref(ctx->pipe, sr); } } @@ -870,7 +870,7 @@ cso_restore_stencil_ref(struct cso_context *ctx) if (memcmp(&ctx->stencil_ref, &ctx->stencil_ref_saved, sizeof(ctx->stencil_ref))) { ctx->stencil_ref = ctx->stencil_ref_saved; - ctx->pipe->set_stencil_ref(ctx->pipe, &ctx->stencil_ref); + ctx->pipe->set_stencil_ref(ctx->pipe, ctx->stencil_ref); } } diff --git a/src/gallium/auxiliary/cso_cache/cso_context.h b/src/gallium/auxiliary/cso_cache/cso_context.h index 6bbf536001a..3f66ee2b5af 100644 --- a/src/gallium/auxiliary/cso_cache/cso_context.h +++ b/src/gallium/auxiliary/cso_cache/cso_context.h @@ -129,7 +129,7 @@ void cso_set_sample_mask(struct cso_context *cso, unsigned stencil_mask); void cso_set_min_samples(struct cso_context *cso, unsigned min_samples); void cso_set_stencil_ref(struct cso_context *cso, - const struct pipe_stencil_ref *sr); + const struct pipe_stencil_ref sr); void cso_set_render_condition(struct cso_context *cso, struct pipe_query *query, diff --git a/src/gallium/auxiliary/driver_ddebug/dd_context.c b/src/gallium/auxiliary/driver_ddebug/dd_context.c index 40da6cf41c7..628cf1abc89 100644 --- a/src/gallium/auxiliary/driver_ddebug/dd_context.c +++ b/src/gallium/auxiliary/driver_ddebug/dd_context.c @@ -350,7 +350,7 @@ DD_SHADER_NOCREATE(COMPUTE, compute) } DD_IMM_STATE(blend_color, const struct pipe_blend_color, *state, state) -DD_IMM_STATE(stencil_ref, const struct pipe_stencil_ref, *state, state) +DD_IMM_STATE(stencil_ref, const struct pipe_stencil_ref, state, state) DD_IMM_STATE(clip_state, const struct pipe_clip_state, *state, state) DD_IMM_STATE(sample_mask, unsigned, sample_mask, sample_mask) DD_IMM_STATE(min_samples, unsigned, min_samples, min_samples) diff --git a/src/gallium/auxiliary/driver_noop/noop_state.c b/src/gallium/auxiliary/driver_noop/noop_state.c index 4a595302527..6d817ad4eea 100644 --- a/src/gallium/auxiliary/driver_noop/noop_state.c +++ b/src/gallium/auxiliary/driver_noop/noop_state.c @@ -147,7 +147,7 @@ static void noop_set_scissor_states(struct pipe_context *ctx, } static void noop_set_stencil_ref(struct pipe_context *ctx, - const struct pipe_stencil_ref *state) + const struct pipe_stencil_ref state) { } diff --git a/src/gallium/auxiliary/driver_rbug/rbug_context.c b/src/gallium/auxiliary/driver_rbug/rbug_context.c index 090f4a30547..136afa0e0ff 100644 --- a/src/gallium/auxiliary/driver_rbug/rbug_context.c +++ b/src/gallium/auxiliary/driver_rbug/rbug_context.c @@ -605,7 +605,7 @@ rbug_set_blend_color(struct pipe_context *_pipe, static void rbug_set_stencil_ref(struct pipe_context *_pipe, - const struct pipe_stencil_ref *stencil_ref) + const struct pipe_stencil_ref stencil_ref) { struct rbug_context *rb_pipe = rbug_context(_pipe); struct pipe_context *pipe = rb_pipe->pipe; diff --git a/src/gallium/auxiliary/driver_trace/tr_context.c b/src/gallium/auxiliary/driver_trace/tr_context.c index 9c079031adc..3265a3d2179 100644 --- a/src/gallium/auxiliary/driver_trace/tr_context.c +++ b/src/gallium/auxiliary/driver_trace/tr_context.c @@ -696,7 +696,7 @@ trace_context_set_blend_color(struct pipe_context *_pipe, static void trace_context_set_stencil_ref(struct pipe_context *_pipe, - const struct pipe_stencil_ref *state) + const struct pipe_stencil_ref state) { struct trace_context *tr_ctx = trace_context(_pipe); struct pipe_context *pipe = tr_ctx->pipe; @@ -704,7 +704,7 @@ trace_context_set_stencil_ref(struct pipe_context *_pipe, trace_dump_call_begin("pipe_context", "set_stencil_ref"); trace_dump_arg(ptr, pipe); - trace_dump_arg(stencil_ref, state); + trace_dump_arg(stencil_ref, &state); pipe->set_stencil_ref(pipe, state); diff --git a/src/gallium/auxiliary/postprocess/pp_mlaa.c b/src/gallium/auxiliary/postprocess/pp_mlaa.c index ac56560a2b9..537fd242b9a 100644 --- a/src/gallium/auxiliary/postprocess/pp_mlaa.c +++ b/src/gallium/auxiliary/postprocess/pp_mlaa.c @@ -85,7 +85,7 @@ pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in, memset(&mstencil, 0, sizeof(mstencil)); - cso_set_stencil_ref(p->cso, &ref); + cso_set_stencil_ref(p->cso, ref); /* Init the pixel size constant */ if (dimensions[0] != p->framebuffer.width || diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index 60c4144c626..cb7baa25336 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -714,7 +714,7 @@ void util_blitter_restore_fragment_states(struct blitter_context *blitter) /* Miscellaneous states. */ /* XXX check whether these are saved and whether they need to be restored * (depending on the operation) */ - pipe->set_stencil_ref(pipe, &ctx->base.saved_stencil_ref); + pipe->set_stencil_ref(pipe, ctx->base.saved_stencil_ref); if (!blitter->skip_viewport_restore) pipe->set_viewport_states(pipe, 0, 1, &ctx->base.saved_viewport); @@ -1496,7 +1496,7 @@ static void util_blitter_clear_custom(struct blitter_context *blitter, custom_blend, custom_dsa); sr.ref_value[0] = stencil & 0xff; - pipe->set_stencil_ref(pipe, &sr); + pipe->set_stencil_ref(pipe, sr); bind_fs_write_all_cbufs(ctx); @@ -2363,7 +2363,7 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter, if ((clear_flags & PIPE_CLEAR_DEPTHSTENCIL) == PIPE_CLEAR_DEPTHSTENCIL) { sr.ref_value[0] = stencil & 0xff; pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_write_depth_stencil); - pipe->set_stencil_ref(pipe, &sr); + pipe->set_stencil_ref(pipe, sr); } else if (clear_flags & PIPE_CLEAR_DEPTH) { pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_write_depth_keep_stencil); @@ -2371,7 +2371,7 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter, else if (clear_flags & PIPE_CLEAR_STENCIL) { sr.ref_value[0] = stencil & 0xff; pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_write_stencil); - pipe->set_stencil_ref(pipe, &sr); + pipe->set_stencil_ref(pipe, sr); } else /* hmm that should be illegal probably, or make it a no-op somewhere */ @@ -2892,7 +2892,7 @@ util_blitter_stencil_fallback(struct blitter_context *blitter, UTIL_FORMAT_COLORSPACE_ZS, 1); struct pipe_stencil_ref sr = { { (1u << stencil_bits) - 1 } }; - pipe->set_stencil_ref(pipe, &sr); + pipe->set_stencil_ref(pipe, sr); union blitter_attrib coord; get_texcoords(src_view, src->width0, src->height0, diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index f2fa3232993..4b60cc7b2a2 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -430,7 +430,7 @@ threaded_context_unwrap_sync(struct pipe_context *pipe) TC_FUNC1(set_active_query_state, flags, , bool, , *) TC_FUNC1(set_blend_color, blend_color, const, struct pipe_blend_color, *, ) -TC_FUNC1(set_stencil_ref, stencil_ref, const, struct pipe_stencil_ref, *, ) +TC_FUNC1(set_stencil_ref, stencil_ref, const, struct pipe_stencil_ref, , *) TC_FUNC1(set_clip_state, clip_state, const, struct pipe_clip_state, *, ) TC_FUNC1(set_sample_mask, sample_mask, , unsigned, , *) TC_FUNC1(set_min_samples, min_samples, , unsigned, , *) diff --git a/src/gallium/drivers/d3d12/d3d12_context.cpp b/src/gallium/drivers/d3d12/d3d12_context.cpp index 1fa121740ce..9a21d5b95ae 100644 --- a/src/gallium/drivers/d3d12/d3d12_context.cpp +++ b/src/gallium/drivers/d3d12/d3d12_context.cpp @@ -1278,13 +1278,13 @@ d3d12_set_sample_mask(struct pipe_context *pctx, unsigned sample_mask) static void d3d12_set_stencil_ref(struct pipe_context *pctx, - const struct pipe_stencil_ref *ref) + const struct pipe_stencil_ref ref) { struct d3d12_context *ctx = d3d12_context(pctx); - if ((ref->ref_value[0] != ref->ref_value[1]) && + if ((ref.ref_value[0] != ref.ref_value[1]) && (d3d12_debug & D3D12_DEBUG_VERBOSE)) debug_printf("D3D12: Different values for front and back stencil reference are not supported\n"); - ctx->stencil_ref = *ref; + ctx->stencil_ref = ref; ctx->state_dirty |= D3D12_DIRTY_STENCIL_REF; } diff --git a/src/gallium/drivers/etnaviv/etnaviv_state.c b/src/gallium/drivers/etnaviv/etnaviv_state.c index 1b4a7040b50..3e837acc708 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_state.c +++ b/src/gallium/drivers/etnaviv/etnaviv_state.c @@ -48,18 +48,18 @@ #include "util/u_upload_mgr.h" static void -etna_set_stencil_ref(struct pipe_context *pctx, const struct pipe_stencil_ref *sr) +etna_set_stencil_ref(struct pipe_context *pctx, const struct pipe_stencil_ref sr) { struct etna_context *ctx = etna_context(pctx); struct compiled_stencil_ref *cs = &ctx->stencil_ref; - ctx->stencil_ref_s = *sr; + ctx->stencil_ref_s = sr; for (unsigned i = 0; i < 2; i++) { cs->PE_STENCIL_CONFIG[i] = - VIVS_PE_STENCIL_CONFIG_REF_FRONT(sr->ref_value[i]); + VIVS_PE_STENCIL_CONFIG_REF_FRONT(sr.ref_value[i]); cs->PE_STENCIL_CONFIG_EXT[i] = - VIVS_PE_STENCIL_CONFIG_EXT_REF_BACK(sr->ref_value[!i]); + VIVS_PE_STENCIL_CONFIG_EXT_REF_BACK(sr.ref_value[!i]); } ctx->dirty |= ETNA_DIRTY_STENCIL_REF; } diff --git a/src/gallium/drivers/freedreno/freedreno_blitter.c b/src/gallium/drivers/freedreno/freedreno_blitter.c index cefb8502640..e8e2972c462 100644 --- a/src/gallium/drivers/freedreno/freedreno_blitter.c +++ b/src/gallium/drivers/freedreno/freedreno_blitter.c @@ -189,7 +189,7 @@ fd_blitter_clear(struct pipe_context *pctx, unsigned buffers, struct pipe_stencil_ref sr = { .ref_value = { stencil & 0xff } }; - pctx->set_stencil_ref(pctx, &sr); + pctx->set_stencil_ref(pctx, sr); struct pipe_constant_buffer cb = { .buffer_size = 16, diff --git a/src/gallium/drivers/freedreno/freedreno_state.c b/src/gallium/drivers/freedreno/freedreno_state.c index 5a3df1f3fd1..06c86ad97f0 100644 --- a/src/gallium/drivers/freedreno/freedreno_state.c +++ b/src/gallium/drivers/freedreno/freedreno_state.c @@ -54,10 +54,10 @@ fd_set_blend_color(struct pipe_context *pctx, static void fd_set_stencil_ref(struct pipe_context *pctx, - const struct pipe_stencil_ref *stencil_ref) + const struct pipe_stencil_ref stencil_ref) { struct fd_context *ctx = fd_context(pctx); - ctx->stencil_ref =* stencil_ref; + ctx->stencil_ref = stencil_ref; ctx->dirty |= FD_DIRTY_STENCIL_REF; } diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index d8a5edfebf4..2ef14c30cd7 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -207,11 +207,11 @@ static void i915_set_blend_color( struct pipe_context *pipe, } static void i915_set_stencil_ref( struct pipe_context *pipe, - const struct pipe_stencil_ref *stencil_ref ) + const struct pipe_stencil_ref stencil_ref ) { struct i915_context *i915 = i915_context(pipe); - i915->stencil_ref = *stencil_ref; + i915->stencil_ref = stencil_ref; i915->dirty |= I915_NEW_DEPTH_STENCIL; } diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 409928a70fe..3aa0ea5b311 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -3021,10 +3021,10 @@ iris_set_scissor_states(struct pipe_context *ctx, */ static void iris_set_stencil_ref(struct pipe_context *ctx, - const struct pipe_stencil_ref *state) + const struct pipe_stencil_ref state) { struct iris_context *ice = (struct iris_context *) ctx; - memcpy(&ice->state.stencil_ref, state, sizeof(*state)); + memcpy(&ice->state.stencil_ref, &state, sizeof(state)); if (GEN_GEN >= 12) ice->state.dirty |= IRIS_DIRTY_STENCIL_REF; else if (GEN_GEN >= 9) diff --git a/src/gallium/drivers/lima/lima_state.c b/src/gallium/drivers/lima/lima_state.c index 74a1a275db2..69582e6c137 100644 --- a/src/gallium/drivers/lima/lima_state.c +++ b/src/gallium/drivers/lima/lima_state.c @@ -246,11 +246,11 @@ lima_set_blend_color(struct pipe_context *pctx, static void lima_set_stencil_ref(struct pipe_context *pctx, - const struct pipe_stencil_ref *stencil_ref) + const struct pipe_stencil_ref stencil_ref) { struct lima_context *ctx = lima_context(pctx); - ctx->stencil_ref = *stencil_ref; + ctx->stencil_ref = stencil_ref; ctx->dirty |= LIMA_CONTEXT_DIRTY_STENCIL_REF; } diff --git a/src/gallium/drivers/llvmpipe/lp_state_blend.c b/src/gallium/drivers/llvmpipe/lp_state_blend.c index ddf2c206a4c..bd61a40f48a 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_blend.c +++ b/src/gallium/drivers/llvmpipe/lp_state_blend.c @@ -155,19 +155,16 @@ llvmpipe_delete_depth_stencil_state(struct pipe_context *pipe, void *depth) static void llvmpipe_set_stencil_ref(struct pipe_context *pipe, - const struct pipe_stencil_ref *stencil_ref) + const struct pipe_stencil_ref stencil_ref) { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); - if (!stencil_ref) - return; - - if(memcmp(&llvmpipe->stencil_ref, stencil_ref, sizeof *stencil_ref) == 0) + if(memcmp(&llvmpipe->stencil_ref, &stencil_ref, sizeof stencil_ref) == 0) return; draw_flush(llvmpipe->draw); - memcpy(&llvmpipe->stencil_ref, stencil_ref, sizeof *stencil_ref); + memcpy(&llvmpipe->stencil_ref, &stencil_ref, sizeof stencil_ref); /* not sure. want new flag? */ llvmpipe->dirty |= LP_NEW_DEPTH_STENCIL_ALPHA; diff --git a/src/gallium/drivers/nouveau/nv30/nv30_state.c b/src/gallium/drivers/nouveau/nv30/nv30_state.c index 09fdc80abc3..27120bfc55e 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_state.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_state.c @@ -297,11 +297,11 @@ nv30_set_blend_color(struct pipe_context *pipe, static void nv30_set_stencil_ref(struct pipe_context *pipe, - const struct pipe_stencil_ref *sr) + const struct pipe_stencil_ref sr) { struct nv30_context *nv30 = nv30_context(pipe); - nv30->stencil_ref = *sr; + nv30->stencil_ref = sr; nv30->dirty |= NV30_NEW_STENCIL_REF; } diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c index c176fa6fe93..8e80e68698a 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c @@ -949,11 +949,11 @@ nv50_set_blend_color(struct pipe_context *pipe, static void nv50_set_stencil_ref(struct pipe_context *pipe, - const struct pipe_stencil_ref *sr) + const struct pipe_stencil_ref sr) { struct nv50_context *nv50 = nv50_context(pipe); - nv50->stencil_ref = *sr; + nv50->stencil_ref = sr; nv50->dirty_3d |= NV50_NEW_3D_STENCIL_REF; } diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c index 2f00bd1c937..9605d347f6d 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c @@ -841,11 +841,11 @@ nvc0_set_blend_color(struct pipe_context *pipe, static void nvc0_set_stencil_ref(struct pipe_context *pipe, - const struct pipe_stencil_ref *sr) + const struct pipe_stencil_ref sr) { struct nvc0_context *nvc0 = nvc0_context(pipe); - nvc0->stencil_ref = *sr; + nvc0->stencil_ref = sr; nvc0->dirty_3d |= NVC0_NEW_3D_STENCIL_REF; } diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index ecef80906e6..fda0ea149b6 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -964,10 +964,10 @@ panfrost_set_constant_buffer( static void panfrost_set_stencil_ref( struct pipe_context *pctx, - const struct pipe_stencil_ref *ref) + const struct pipe_stencil_ref ref) { struct panfrost_context *ctx = pan_context(pctx); - ctx->stencil_ref = *ref; + ctx->stencil_ref = ref; } void diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 7f120f00aff..348f9621b5e 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -817,11 +817,11 @@ static void r300_delete_dsa_state(struct pipe_context* pipe, } static void r300_set_stencil_ref(struct pipe_context* pipe, - const struct pipe_stencil_ref* sr) + const struct pipe_stencil_ref sr) { struct r300_context* r300 = r300_context(pipe); - r300->stencil_ref = *sr; + r300->stencil_ref = sr; r300_dsa_inject_stencilref(r300); r300_mark_atom_dirty(r300, &r300->dsa_state); diff --git a/src/gallium/drivers/r600/r600_state_common.c b/src/gallium/drivers/r600/r600_state_common.c index fc002fdd92c..3490ca55b81 100644 --- a/src/gallium/drivers/r600/r600_state_common.c +++ b/src/gallium/drivers/r600/r600_state_common.c @@ -285,11 +285,11 @@ static void r600_set_clip_state(struct pipe_context *ctx, } static void r600_set_stencil_ref(struct pipe_context *ctx, - const struct r600_stencil_ref *state) + const struct r600_stencil_ref state) { struct r600_context *rctx = (struct r600_context *)ctx; - rctx->stencil_ref.state = *state; + rctx->stencil_ref.state = state; r600_mark_atom_dirty(rctx, &rctx->stencil_ref.atom); } @@ -310,25 +310,25 @@ void r600_emit_stencil_ref(struct r600_context *rctx, struct r600_atom *atom) } static void r600_set_pipe_stencil_ref(struct pipe_context *ctx, - const struct pipe_stencil_ref *state) + const struct pipe_stencil_ref state) { struct r600_context *rctx = (struct r600_context *)ctx; struct r600_dsa_state *dsa = (struct r600_dsa_state*)rctx->dsa_state.cso; struct r600_stencil_ref ref; - rctx->stencil_ref.pipe_state = *state; + rctx->stencil_ref.pipe_state = state; if (!dsa) return; - ref.ref_value[0] = state->ref_value[0]; - ref.ref_value[1] = state->ref_value[1]; + ref.ref_value[0] = state.ref_value[0]; + ref.ref_value[1] = state.ref_value[1]; ref.valuemask[0] = dsa->valuemask[0]; ref.valuemask[1] = dsa->valuemask[1]; ref.writemask[0] = dsa->writemask[0]; ref.writemask[1] = dsa->writemask[1]; - r600_set_stencil_ref(ctx, &ref); + r600_set_stencil_ref(ctx, ref); } static void r600_bind_dsa_state(struct pipe_context *ctx, void *state) @@ -361,7 +361,7 @@ static void r600_bind_dsa_state(struct pipe_context *ctx, void *state) } } - r600_set_stencil_ref(ctx, &ref); + r600_set_stencil_ref(ctx, ref); /* Update alphatest state. */ if (rctx->alphatest_state.sx_alpha_test_control != dsa->sx_alpha_test_control || diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index f407c6d89d5..6033af77e6f 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -1059,14 +1059,14 @@ static void si_emit_stencil_ref(struct si_context *sctx) S_028434_STENCILOPVAL_BF(1)); } -static void si_set_stencil_ref(struct pipe_context *ctx, const struct pipe_stencil_ref *state) +static void si_set_stencil_ref(struct pipe_context *ctx, const struct pipe_stencil_ref state) { struct si_context *sctx = (struct si_context *)ctx; - if (memcmp(&sctx->stencil_ref.state, state, sizeof(*state)) == 0) + if (memcmp(&sctx->stencil_ref.state, &state, sizeof(state)) == 0) return; - sctx->stencil_ref.state = *state; + sctx->stencil_ref.state = state; si_mark_atom_dirty(sctx, &sctx->atoms.s.stencil_ref); } diff --git a/src/gallium/drivers/softpipe/sp_state_blend.c b/src/gallium/drivers/softpipe/sp_state_blend.c index 7351e09a5bb..ca98d1cc856 100644 --- a/src/gallium/drivers/softpipe/sp_state_blend.c +++ b/src/gallium/drivers/softpipe/sp_state_blend.c @@ -114,11 +114,11 @@ softpipe_delete_depth_stencil_state(struct pipe_context *pipe, void *depth) static void softpipe_set_stencil_ref(struct pipe_context *pipe, - const struct pipe_stencil_ref *stencil_ref) + const struct pipe_stencil_ref stencil_ref) { struct softpipe_context *softpipe = softpipe_context(pipe); - softpipe->stencil_ref = *stencil_ref; + softpipe->stencil_ref = stencil_ref; softpipe->dirty |= SP_NEW_DEPTH_STENCIL_ALPHA; } diff --git a/src/gallium/drivers/svga/svga_pipe_depthstencil.c b/src/gallium/drivers/svga/svga_pipe_depthstencil.c index 55878c89532..7a5fb89e0fa 100644 --- a/src/gallium/drivers/svga/svga_pipe_depthstencil.c +++ b/src/gallium/drivers/svga/svga_pipe_depthstencil.c @@ -263,7 +263,7 @@ svga_delete_depth_stencil_state(struct pipe_context *pipe, void *depth_stencil) static void svga_set_stencil_ref(struct pipe_context *pipe, - const struct pipe_stencil_ref *stencil_ref) + const struct pipe_stencil_ref stencil_ref) { struct svga_context *svga = svga_context(pipe); @@ -272,7 +272,7 @@ svga_set_stencil_ref(struct pipe_context *pipe, svga_hwtnl_flush_retry(svga); } - svga->curr.stencil_ref = *stencil_ref; + svga->curr.stencil_ref = stencil_ref; svga->dirty |= SVGA_NEW_STENCIL_REF; } diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp index 2318e91ad99..bf79e35300f 100644 --- a/src/gallium/drivers/swr/swr_state.cpp +++ b/src/gallium/drivers/swr/swr_state.cpp @@ -164,11 +164,11 @@ swr_set_blend_color(struct pipe_context *pipe, static void swr_set_stencil_ref(struct pipe_context *pipe, - const struct pipe_stencil_ref *ref) + const struct pipe_stencil_ref ref) { struct swr_context *ctx = swr_context(pipe); - ctx->stencil_ref = *ref; + ctx->stencil_ref = ref; ctx->dirty |= SWR_NEW_DEPTH_STENCIL_ALPHA; } diff --git a/src/gallium/drivers/tegra/tegra_context.c b/src/gallium/drivers/tegra/tegra_context.c index 9f331e919a5..63f0b59d9a5 100644 --- a/src/gallium/drivers/tegra/tegra_context.c +++ b/src/gallium/drivers/tegra/tegra_context.c @@ -431,7 +431,7 @@ tegra_set_blend_color(struct pipe_context *pcontext, static void tegra_set_stencil_ref(struct pipe_context *pcontext, - const struct pipe_stencil_ref *ref) + const struct pipe_stencil_ref ref) { struct tegra_context *context = to_tegra_context(pcontext); diff --git a/src/gallium/drivers/v3d/v3dx_state.c b/src/gallium/drivers/v3d/v3dx_state.c index 050bd3b81af..d625a22026f 100644 --- a/src/gallium/drivers/v3d/v3dx_state.c +++ b/src/gallium/drivers/v3d/v3dx_state.c @@ -59,10 +59,10 @@ v3d_set_blend_color(struct pipe_context *pctx, static void v3d_set_stencil_ref(struct pipe_context *pctx, - const struct pipe_stencil_ref *stencil_ref) + const struct pipe_stencil_ref stencil_ref) { struct v3d_context *v3d = v3d_context(pctx); - v3d->stencil_ref = *stencil_ref; + v3d->stencil_ref = stencil_ref; v3d->dirty |= VC5_DIRTY_STENCIL_REF; } diff --git a/src/gallium/drivers/vc4/vc4_state.c b/src/gallium/drivers/vc4/vc4_state.c index 77431e4557c..481eaddf401 100644 --- a/src/gallium/drivers/vc4/vc4_state.c +++ b/src/gallium/drivers/vc4/vc4_state.c @@ -60,10 +60,10 @@ vc4_set_blend_color(struct pipe_context *pctx, static void vc4_set_stencil_ref(struct pipe_context *pctx, - const struct pipe_stencil_ref *stencil_ref) + const struct pipe_stencil_ref stencil_ref) { struct vc4_context *vc4 = vc4_context(pctx); - vc4->stencil_ref =* stencil_ref; + vc4->stencil_ref = stencil_ref; vc4->dirty |= VC4_DIRTY_STENCIL_REF; } diff --git a/src/gallium/drivers/virgl/virgl_context.c b/src/gallium/drivers/virgl/virgl_context.c index 40ba18badba..067a89a1f2c 100644 --- a/src/gallium/drivers/virgl/virgl_context.c +++ b/src/gallium/drivers/virgl/virgl_context.c @@ -610,10 +610,10 @@ static void virgl_hw_set_vertex_buffers(struct virgl_context *vctx) } static void virgl_set_stencil_ref(struct pipe_context *ctx, - const struct pipe_stencil_ref *ref) + const struct pipe_stencil_ref ref) { struct virgl_context *vctx = virgl_context(ctx); - virgl_encoder_set_stencil_ref(vctx, ref); + virgl_encoder_set_stencil_ref(vctx, &ref); } static void virgl_set_blend_color(struct pipe_context *ctx, diff --git a/src/gallium/drivers/zink/zink_context.c b/src/gallium/drivers/zink/zink_context.c index 7d89a8863f1..01da0965486 100644 --- a/src/gallium/drivers/zink/zink_context.c +++ b/src/gallium/drivers/zink/zink_context.c @@ -583,10 +583,10 @@ zink_set_sampler_views(struct pipe_context *pctx, static void zink_set_stencil_ref(struct pipe_context *pctx, - const struct pipe_stencil_ref *ref) + const struct pipe_stencil_ref ref) { struct zink_context *ctx = zink_context(pctx); - ctx->stencil_ref = *ref; + ctx->stencil_ref = ref; } static void diff --git a/src/gallium/frontends/lavapipe/lvp_execute.c b/src/gallium/frontends/lavapipe/lvp_execute.c index f03eed98144..c9c0d6f4445 100644 --- a/src/gallium/frontends/lavapipe/lvp_execute.c +++ b/src/gallium/frontends/lavapipe/lvp_execute.c @@ -231,7 +231,7 @@ static void emit_state(struct rendering_state *state) } if (state->stencil_ref_dirty) { - state->pctx->set_stencil_ref(state->pctx, &state->stencil_ref); + state->pctx->set_stencil_ref(state->pctx, state->stencil_ref); state->stencil_ref_dirty = false; } diff --git a/src/gallium/frontends/nine/nine_state.c b/src/gallium/frontends/nine/nine_state.c index 5fa90aaad21..e99c2a082d7 100644 --- a/src/gallium/frontends/nine/nine_state.c +++ b/src/gallium/frontends/nine/nine_state.c @@ -1283,7 +1283,7 @@ nine_update_state(struct NineDevice9 *device) struct pipe_stencil_ref ref; ref.ref_value[0] = context->rs[D3DRS_STENCILREF]; ref.ref_value[1] = ref.ref_value[0]; - pipe->set_stencil_ref(pipe, &ref); + pipe->set_stencil_ref(pipe, ref); } } diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h index 7322bc5f5c1..59657fe0be4 100644 --- a/src/gallium/include/pipe/p_context.h +++ b/src/gallium/include/pipe/p_context.h @@ -337,7 +337,7 @@ struct pipe_context { const struct pipe_blend_color * ); void (*set_stencil_ref)( struct pipe_context *, - const struct pipe_stencil_ref * ); + const struct pipe_stencil_ref ref); void (*set_sample_mask)( struct pipe_context *, unsigned sample_mask ); diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c index c6995812e4e..5ebb1d77a1e 100644 --- a/src/mesa/state_tracker/st_atom_depth.c +++ b/src/mesa/state_tracker/st_atom_depth.c @@ -157,5 +157,5 @@ st_update_depth_stencil_alpha(struct st_context *st) } cso_set_depth_stencil_alpha(st->cso_context, dsa); - cso_set_stencil_ref(st->cso_context, &sr); + cso_set_stencil_ref(st->cso_context, sr); } diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 9fd62b32543..da40756f310 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -316,7 +316,7 @@ clear_with_quad(struct gl_context *ctx, unsigned clear_buffers) depth_stencil.stencil[0].valuemask = 0xff; depth_stencil.stencil[0].writemask = ctx->Stencil.WriteMask[0] & 0xff; stencil_ref.ref_value[0] = ctx->Stencil.Clear; - cso_set_stencil_ref(cso, &stencil_ref); + cso_set_stencil_ref(cso, stencil_ref); } cso_set_depth_stencil_alpha(cso, &depth_stencil);