radeonsi: fold info->indirect conditionals into the last one in draw_vbo
authorMarek Olšák <marek.olsak@amd.com>
Thu, 26 Jan 2017 02:02:23 +0000 (03:02 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 30 Jan 2017 16:29:36 +0000 (17:29 +0100)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_state_draw.c

index fb5954eb6c593f3ec0acfd44e2f71df1ff332615..aa79b8fcb58fc0826a8018dc7d6df03c33f7bd54 100644 (file)
@@ -1102,20 +1102,21 @@ void si_draw_vbo(struct pipe_context *ctx, const struct pipe_draw_info *info)
                r600_resource(ib.buffer)->TC_L2_dirty = false;
        }
 
-       if (info->indirect && r600_resource(info->indirect)->TC_L2_dirty) {
-               sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
-               r600_resource(info->indirect)->TC_L2_dirty = false;
-       }
+       if (info->indirect) {
+               /* Add the buffer size for memory checking in need_cs_space. */
+               r600_context_add_resource_size(ctx, info->indirect);
 
-       if (info->indirect_params &&
-           r600_resource(info->indirect_params)->TC_L2_dirty) {
-               sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
-               r600_resource(info->indirect_params)->TC_L2_dirty = false;
-       }
+               if (r600_resource(info->indirect)->TC_L2_dirty) {
+                       sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
+                       r600_resource(info->indirect)->TC_L2_dirty = false;
+               }
 
-       /* Add buffer sizes for memory checking in need_cs_space. */
-       if (info->indirect)
-               r600_context_add_resource_size(ctx, info->indirect);
+               if (info->indirect_params &&
+                   r600_resource(info->indirect_params)->TC_L2_dirty) {
+                       sctx->b.flags |= SI_CONTEXT_WRITEBACK_GLOBAL_L2;
+                       r600_resource(info->indirect_params)->TC_L2_dirty = false;
+               }
+       }
 
        si_need_cs_space(sctx);