summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2018-06-13 23:31:54 +0200
committerDylan Baker <[email protected]>2018-06-15 13:55:04 -0700
commitc41a74622dd1f22b0d2fb23583bdae1b7b3ee3d8 (patch)
tree34070390a107fca1da40976ca1188f7e5d1b989f /src
parentdd355ee90eaeeabdbdaaa0175fff4aa69a29ace6 (diff)
radv: Fix output for sparse MRTs.
We need to init the cb_shader_format correctly with the changed col_format, so this moves the col_format adjustment to before the adjustment to before the cb_shader_mask gets generated. Fixes: 06d3c650980 "radv: fix a GPU hang when MRTs are sparse" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106903 CC: 18.1 <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> (cherry picked from commit 41dabdc47538fb7660f7063d9dd423473eaa2515)
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_pipeline.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index bbb65f69bf5..d42df7ca8da 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -524,20 +524,21 @@ radv_pipeline_compute_spi_color_formats(struct radv_pipeline *pipeline,
col_format |= cf << (4 * i);
}
- blend->cb_shader_mask = ac_get_cb_shader_mask(col_format);
-
- if (blend->mrt0_is_dual_src)
- col_format |= (col_format & 0xf) << 4;
- blend->spi_shader_col_format = col_format;
-
/* If the i-th target format is set, all previous target formats must
* be non-zero to avoid hangs.
*/
- num_targets = (util_last_bit(blend->spi_shader_col_format) + 3) / 4;
+ num_targets = (util_last_bit(col_format) + 3) / 4;
for (unsigned i = 0; i < num_targets; i++) {
- if (!(blend->spi_shader_col_format & (0xf << (i * 4))))
- blend->spi_shader_col_format |= V_028714_SPI_SHADER_32_R << (i * 4);
+ if (!(col_format & (0xf << (i * 4)))) {
+ col_format |= V_028714_SPI_SHADER_32_R << (i * 4);
+ }
}
+
+ blend->cb_shader_mask = ac_get_cb_shader_mask(col_format);
+
+ if (blend->mrt0_is_dual_src)
+ col_format |= (col_format & 0xf) << 4;
+ blend->spi_shader_col_format = col_format;
}
static bool