tgsi/scan: add uses_fbfetch
authorMarek Olšák <marek.olsak@amd.com>
Tue, 23 Jul 2019 01:08:48 +0000 (21:08 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 23 Jul 2019 19:08:37 +0000 (15:08 -0400)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c
src/gallium/auxiliary/tgsi/tgsi_scan.h
src/gallium/drivers/radeonsi/si_descriptors.c

index 4cb1a3152c3b8faeb9d784a8d3bba647e4d80b00..37a223a0f68ee0d7e533b47b80df4b885c8dcf22 100644 (file)
@@ -411,6 +411,9 @@ scan_instruction(struct tgsi_shader_info *info,
             info->uses_bindless_image_store = true;
       }
       break;
+   case TGSI_OPCODE_FBFETCH:
+      info->uses_fbfetch = true;
+      break;
    default:
       break;
    }
index 51d85af4fcb8b613d23a3cb1adc62b18879d722f..a2938e5fd382f2688a97769618bd38cbd9964466 100644 (file)
@@ -137,6 +137,7 @@ struct tgsi_shader_info
    boolean uses_derivatives;
    boolean uses_bindless_samplers;
    boolean uses_bindless_images;
+   boolean uses_fbfetch;
    unsigned clipdist_writemask;
    unsigned culldist_writemask;
    unsigned num_written_culldistance;
index f7bd589e6d368a0ac57878f433f8c5e2a9d2f4aa..6d95cd7e891ae7beeb7296e784dccaa85b3d4e64 100644 (file)
@@ -899,7 +899,7 @@ void si_update_ps_colorbuf0_slot(struct si_context *sctx)
 
        /* See whether FBFETCH is used and color buffer 0 is set. */
        if (sctx->ps_shader.cso &&
-           sctx->ps_shader.cso->info.opcode_count[TGSI_OPCODE_FBFETCH] &&
+           sctx->ps_shader.cso->info.uses_fbfetch &&
            sctx->framebuffer.state.nr_cbufs &&
            sctx->framebuffer.state.cbufs[0])
                surf = sctx->framebuffer.state.cbufs[0];