si_get_total_colormask accesses NULL pointer on compute shaders
Fixes crashes on clover
Fixes: 0669dca9c00261849cee14d69fdea0a5e323c7f7 ("radeonsi: skip DCC render feedback checking if color writes are disabled")
CC: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
static void si_check_render_feedback(struct si_context *sctx)
{
+ if (!sctx->need_check_render_feedback)
+ return;
+
/* There is no render feedback if color writes are disabled.
* (e.g. a pixel shader with image stores)
*/
if (!si_get_total_colormask(sctx))
return;
- if (!sctx->need_check_render_feedback)
- return;
-
for (int i = 0; i < SI_NUM_SHADERS; ++i) {
si_check_render_feedback_images(sctx, &sctx->images[i]);
si_check_render_feedback_textures(sctx, &sctx->samplers[i]);