if (desc->dirty_mask) {
desc->atom.num_dw =
7 + /* copy */
- (4 + desc->element_dw_size) * util_bitcount(desc->dirty_mask) + /* update */
+ (4 + desc->element_dw_size) * util_bitcount64(desc->dirty_mask) + /* update */
4; /* pointer update */
if (desc->shader_userdata_reg >= R_00B130_SPI_SHADER_USER_DATA_VS_0 &&
int packet_start = 0;
int packet_size = 0;
int last_index = desc->num_elements; /* point to a non-existing element */
- unsigned dirty_mask = desc->dirty_mask;
+ uint64_t dirty_mask = desc->dirty_mask;
unsigned new_context_id = (desc->current_context_id + 1) % SI_NUM_CONTEXTS;
assert(dirty_mask);
* with CP DMA instead of emitting zeros.
*/
while (dirty_mask) {
- int i = u_bit_scan(&dirty_mask);
+ int i = u_bit_scan64(&dirty_mask);
assert(i < desc->num_elements);
static void si_sampler_views_begin_new_cs(struct si_context *sctx,
struct si_sampler_views *views)
{
- unsigned mask = views->desc.enabled_mask;
+ uint64_t mask = views->desc.enabled_mask;
/* Add relocations to the CS. */
while (mask) {
- int i = u_bit_scan(&mask);
+ int i = u_bit_scan64(&mask);
struct si_sampler_view *rview =
(struct si_sampler_view*)views->views[i];
pipe_sampler_view_reference(&views->views[slot], view);
views->desc_data[slot] = view_desc;
- views->desc.enabled_mask |= 1 << slot;
+ views->desc.enabled_mask |= 1llu << slot;
} else {
pipe_sampler_view_reference(&views->views[slot], NULL);
views->desc_data[slot] = null_descriptor;
- views->desc.enabled_mask &= ~(1 << slot);
+ views->desc.enabled_mask &= ~(1llu << slot);
}
- views->desc.dirty_mask |= 1 << slot;
+ views->desc.dirty_mask |= 1llu << slot;
}
static void si_set_sampler_views(struct pipe_context *ctx,
unsigned slot = start + i;
if (!sstates[i]) {
- samplers->desc.dirty_mask &= ~(1 << slot);
+ samplers->desc.dirty_mask &= ~(1llu << slot);
continue;
}
samplers->desc_data[slot] = sstates[i]->val;
- samplers->desc.dirty_mask |= 1 << slot;
+ samplers->desc.dirty_mask |= 1llu << slot;
}
si_update_descriptors(sctx, &samplers->desc);
static void si_buffer_resources_begin_new_cs(struct si_context *sctx,
struct si_buffer_resources *buffers)
{
- unsigned mask = buffers->desc.enabled_mask;
+ uint64_t mask = buffers->desc.enabled_mask;
/* Add relocations to the CS. */
while (mask) {
- int i = u_bit_scan(&mask);
+ int i = u_bit_scan64(&mask);
r600_context_bo_reloc(&sctx->b, &sctx->b.rings.gfx,
(struct r600_resource*)buffers->buffers[i],
r600_context_bo_reloc(&sctx->b, &sctx->b.rings.gfx,
(struct r600_resource*)buffer,
buffers->shader_usage, buffers->priority);
- buffers->desc.enabled_mask |= 1 << slot;
+ buffers->desc.enabled_mask |= 1llu << slot;
} else {
/* Clear the descriptor. */
memset(buffers->desc_data[slot], 0, sizeof(uint32_t) * 4);
- buffers->desc.enabled_mask &= ~(1 << slot);
+ buffers->desc.enabled_mask &= ~(1llu << slot);
}
- buffers->desc.dirty_mask |= 1 << slot;
+ buffers->desc.dirty_mask |= 1llu << slot;
si_update_descriptors(sctx, &buffers->desc);
}
r600_context_bo_reloc(&sctx->b, &sctx->b.rings.gfx,
(struct r600_resource*)buffer,
buffers->shader_usage, buffers->priority);
- buffers->desc.enabled_mask |= 1 << slot;
+ buffers->desc.enabled_mask |= 1llu << slot;
} else {
/* Clear the descriptor. */
memset(buffers->desc_data[slot], 0, sizeof(uint32_t) * 4);
- buffers->desc.enabled_mask &= ~(1 << slot);
+ buffers->desc.enabled_mask &= ~(1llu << slot);
}
- buffers->desc.dirty_mask |= 1 << slot;
+ buffers->desc.dirty_mask |= 1llu << slot;
si_update_descriptors(sctx, &buffers->desc);
}
r600_context_bo_reloc(&sctx->b, &sctx->b.rings.gfx,
(struct r600_resource*)buffer,
buffers->shader_usage, buffers->priority);
- buffers->desc.enabled_mask |= 1 << bufidx;
+ buffers->desc.enabled_mask |= 1llu << bufidx;
} else {
/* Clear the descriptor and unset the resource. */
memset(buffers->desc_data[bufidx], 0,
sizeof(uint32_t) * 4);
pipe_resource_reference(&buffers->buffers[bufidx],
NULL);
- buffers->desc.enabled_mask &= ~(1 << bufidx);
+ buffers->desc.enabled_mask &= ~(1llu << bufidx);
}
- buffers->desc.dirty_mask |= 1 << bufidx;
+ buffers->desc.dirty_mask |= 1llu << bufidx;
}
for (; i < old_num_targets; i++) {
bufidx = SI_SO_BUF_OFFSET + i;
/* Clear the descriptor and unset the resource. */
memset(buffers->desc_data[bufidx], 0, sizeof(uint32_t) * 4);
pipe_resource_reference(&buffers->buffers[bufidx], NULL);
- buffers->desc.enabled_mask &= ~(1 << bufidx);
- buffers->desc.dirty_mask |= 1 << bufidx;
+ buffers->desc.enabled_mask &= ~(1llu << bufidx);
+ buffers->desc.dirty_mask |= 1llu << bufidx;
}
si_update_descriptors(sctx, &buffers->desc);
for (shader = 0; shader < SI_NUM_SHADERS; shader++) {
struct si_buffer_resources *buffers = &sctx->rw_buffers[shader];
bool found = false;
- uint32_t mask = buffers->desc.enabled_mask;
+ uint64_t mask = buffers->desc.enabled_mask;
while (mask) {
- i = u_bit_scan(&mask);
+ i = u_bit_scan64(&mask);
if (buffers->buffers[i] == buf) {
si_desc_reset_buffer_offset(ctx, buffers->desc_data[i],
old_va, buf);
rbuffer, buffers->shader_usage,
buffers->priority);
- buffers->desc.dirty_mask |= 1 << i;
+ buffers->desc.dirty_mask |= 1llu << i;
found = true;
if (i >= SI_SO_BUF_OFFSET && shader == PIPE_SHADER_VERTEX) {
for (shader = 0; shader < SI_NUM_SHADERS; shader++) {
struct si_buffer_resources *buffers = &sctx->const_buffers[shader];
bool found = false;
- uint32_t mask = buffers->desc.enabled_mask;
+ uint64_t mask = buffers->desc.enabled_mask;
while (mask) {
- unsigned i = u_bit_scan(&mask);
+ unsigned i = u_bit_scan64(&mask);
if (buffers->buffers[i] == buf) {
si_desc_reset_buffer_offset(ctx, buffers->desc_data[i],
old_va, buf);
rbuffer, buffers->shader_usage,
buffers->priority);
- buffers->desc.dirty_mask |= 1 << i;
+ buffers->desc.dirty_mask |= 1llu << i;
found = true;
}
}
for (shader = 0; shader < SI_NUM_SHADERS; shader++) {
struct si_sampler_views *views = &sctx->samplers[shader].views;
bool found = false;
- uint32_t mask = views->desc.enabled_mask;
+ uint64_t mask = views->desc.enabled_mask;
while (mask) {
- unsigned i = u_bit_scan(&mask);
+ unsigned i = u_bit_scan64(&mask);
if (views->views[i]->texture == buf) {
r600_context_bo_reloc(&sctx->b, &sctx->b.rings.gfx,
rbuffer, RADEON_USAGE_READ,
RADEON_PRIO_SHADER_BUFFER_RO);
- views->desc.dirty_mask |= 1 << i;
+ views->desc.dirty_mask |= 1llu << i;
found = true;
}
}