diff options
author | Marek Olšák <[email protected]> | 2016-12-02 03:34:07 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-12-07 19:40:03 +0100 |
commit | 6caa558ca677941f9a2f0570563b51fbe88cd1b9 (patch) | |
tree | 15378a5a10bb75f9818e41e9f5484a85955c6265 /src/gallium/drivers/radeonsi/si_state.c | |
parent | f2b0c66c3c012023433874b6e28f8cc8c3f64139 (diff) |
radeonsi: check for sampler state CSO corruption
It really happens.
v2: declare "magic" in debug builds only
Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.c')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 1ccf5b6b214..04c1a9f4c66 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -3247,6 +3247,9 @@ static void *si_create_sampler_state(struct pipe_context *ctx, } } +#ifdef DEBUG + rstate->magic = SI_SAMPLER_STATE_MAGIC; +#endif rstate->val[0] = (S_008F30_CLAMP_X(si_tex_wrap(state->wrap_s)) | S_008F30_CLAMP_Y(si_tex_wrap(state->wrap_t)) | S_008F30_CLAMP_Z(si_tex_wrap(state->wrap_r)) | @@ -3303,6 +3306,12 @@ static void si_emit_sample_mask(struct si_context *sctx, struct r600_atom *atom) static void si_delete_sampler_state(struct pipe_context *ctx, void *state) { + struct si_sampler_state *s = state; + +#ifdef DEBUG + assert(s->magic == SI_SAMPLER_STATE_MAGIC); + s->magic = 0; +#endif free(state); } |