}
descs->dirty_mask |= 1u << slot;
+ sctx->descriptors_dirty |= 1u << si_sampler_descriptors_idx(shader);
}
static bool is_compressed_colortex(struct r600_texture *rtex)
memcpy(descs->list + slot*8, null_image_descriptor, 8*4);
images->enabled_mask &= ~(1u << slot);
descs->dirty_mask |= 1u << slot;
+ ctx->descriptors_dirty |= 1u << si_image_descriptors_idx(shader);
}
}
images->enabled_mask |= 1u << slot;
descs->dirty_mask |= 1u << slot;
+ ctx->descriptors_dirty |= 1u << si_image_descriptors_idx(shader);
}
static void
memcpy(desc->list + slot * 16 + 12, sstates[i]->val, 4*4);
desc->dirty_mask |= 1u << slot;
+ sctx->descriptors_dirty |= 1u << si_sampler_descriptors_idx(shader);
}
}
}
descs->dirty_mask |= 1u << slot;
+ sctx->descriptors_dirty |= 1u << descriptors_idx;
}
void si_set_rw_buffer(struct si_context *sctx,
memset(desc, 0, sizeof(uint32_t) * 4);
buffers->enabled_mask &= ~(1u << slot);
descs->dirty_mask |= 1u << slot;
+ sctx->descriptors_dirty |=
+ 1u << si_shader_buffer_descriptors_idx(shader);
continue;
}
buffers->shader_usage, buffers->priority);
buffers->enabled_mask |= 1u << slot;
descs->dirty_mask |= 1u << slot;
+ sctx->descriptors_dirty |=
+ 1u << si_shader_buffer_descriptors_idx(shader);
}
}
}
descs->dirty_mask |= 1u << slot;
+ sctx->descriptors_dirty |= 1u << SI_DESCS_RW_BUFFERS;
}
/* STREAMOUT BUFFERS */
buffers->enabled_mask &= ~(1u << bufidx);
descs->dirty_mask |= 1u << bufidx;
}
+
+ sctx->descriptors_dirty |= 1u << SI_DESCS_RW_BUFFERS;
}
static void si_desc_reset_buffer_offset(struct pipe_context *ctx,
descs->list + i*4,
old_va, buf);
descs->dirty_mask |= 1u << i;
+ sctx->descriptors_dirty |= 1u << descriptors_idx;
radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
(struct r600_resource *)buf,
si_desc_reset_buffer_offset(ctx, descs->list + i*4,
old_va, buf);
descs->dirty_mask |= 1u << i;
+ sctx->descriptors_dirty |= 1u << SI_DESCS_RW_BUFFERS;
radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
rbuffer, buffers->shader_usage,
i * 16 + 4,
old_va, buf);
descs->dirty_mask |= 1u << i;
+ sctx->descriptors_dirty |=
+ 1u << si_sampler_descriptors_idx(shader);
radeon_add_to_buffer_list(&sctx->b, &sctx->b.gfx,
rbuffer, RADEON_USAGE_READ,
ctx, descs->list + i * 8 + 4,
old_va, buf);
descs->dirty_mask |= 1u << i;
+ sctx->descriptors_dirty |=
+ 1u << si_image_descriptors_idx(shader);
radeon_add_to_buffer_list(
&sctx->b, &sctx->b.gfx, rbuffer,
si_init_descriptors(&sctx->vertex_buffers, SI_SGPR_VERTEX_BUFFERS,
4, SI_NUM_VERTEX_BUFFERS, NULL, NULL);
+ sctx->descriptors_dirty = u_bit_consecutive(0, SI_NUM_DESCS);
+
assert(ce_offset <= 32768);
/* Set pipe_context functions. */
bool si_upload_graphics_shader_descriptors(struct si_context *sctx)
{
- int i;
+ const unsigned mask = u_bit_consecutive(0, SI_DESCS_FIRST_COMPUTE);
+ unsigned dirty = sctx->descriptors_dirty & mask;
+
+ while (dirty) {
+ unsigned i = u_bit_scan(&dirty);
- for (i = 0; i < SI_DESCS_FIRST_COMPUTE; ++i) {
if (!si_upload_descriptors(sctx, &sctx->descriptors[i],
&sctx->shader_userdata.atom))
return false;
}
+ sctx->descriptors_dirty &= ~mask;
+
return si_upload_vertex_buffer_descriptors(sctx);
}
/* Does not update rw_buffers as that is not needed for compute shaders
* and the input buffer is using the same SGPR's anyway.
*/
- unsigned i;
+ const unsigned mask = u_bit_consecutive(SI_DESCS_FIRST_COMPUTE,
+ SI_NUM_DESCS - SI_DESCS_FIRST_COMPUTE);
+ unsigned dirty = sctx->descriptors_dirty & mask;
+
+ while (dirty) {
+ unsigned i = u_bit_scan(&dirty);
- for (i = SI_DESCS_FIRST_COMPUTE; i < SI_NUM_DESCS; ++i) {
if (!si_upload_descriptors(sctx, &sctx->descriptors[i], NULL))
return false;
}
+ sctx->descriptors_dirty &= ~mask;
+
return true;
}