radeonsi: Handle NULL sampler states.
authorMichel Dänzer <michel.daenzer@amd.com>
Fri, 7 Sep 2012 15:26:15 +0000 (17:26 +0200)
committerMichel Dänzer <michel@daenzer.net>
Tue, 11 Sep 2012 09:06:16 +0000 (11:06 +0200)
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/radeonsi/si_state.c

index 67880f21ed7be9767715a6fe07685db3b7246c31..524003682aeabacc8848db3822040ca79b0f0f51 100644 (file)
@@ -2310,7 +2310,7 @@ static void si_bind_ps_sampler(struct pipe_context *ctx, unsigned count, void **
        si_pm4_sh_data_begin(pm4);
        for (i = 0; i < count; i++) {
                for (j = 0; j < Elements(rstates[i]->val); ++j) {
-                       si_pm4_sh_data_add(pm4, rstates[i]->val[j]);
+                       si_pm4_sh_data_add(pm4, rstates[i] ? rstates[i]->val[j] : 0);
                }
        }
        si_pm4_sh_data_end(pm4, R_00B038_SPI_SHADER_USER_DATA_PS_2);