OSDN Git Service

radeonsi: Keep around copies of original sampler states.
authorMichel Dänzer <michel.daenzer@amd.com>
Mon, 14 May 2012 14:34:11 +0000 (16:34 +0200)
committerMichel Dänzer <michel@daenzer.net>
Mon, 14 May 2012 15:56:03 +0000 (17:56 +0200)
Fixes crashes when restoring sampler states after blits.

src/gallium/drivers/radeonsi/evergreen_state.c

index 264618b..8043c0c 100644 (file)
@@ -1349,6 +1349,8 @@ static void evergreen_bind_ps_sampler(struct pipe_context *ctx, unsigned count,
 
        rctx->ws->buffer_unmap(bo->cs_buf);
 
+       memcpy(rctx->ps_samplers.samplers, states, sizeof(void*) * count);
+
        rstate->nregs = 0;
        va = r600_resource_va(ctx->screen, (void *)bo);
        r600_pipe_state_add_reg(rstate, R_00B038_SPI_SHADER_USER_DATA_PS_2, va, bo, RADEON_USAGE_READ);