/* Reallocate the buffer in the same pipe_resource. */
si_alloc_resource(sctx->screen, rbuffer);
- si_rebind_buffer(&sctx->b.b, &rbuffer->b.b, old_va);
+ si_rebind_buffer(sctx, &rbuffer->b.b, old_va);
} else {
util_range_set_empty(&rbuffer->valid_buffer_range);
}
struct pipe_resource *dst,
struct pipe_resource *src)
{
+ struct si_context *sctx = (struct si_context*)ctx;
struct r600_resource *rdst = r600_resource(dst);
struct r600_resource *rsrc = r600_resource(src);
uint64_t old_gpu_address = rdst->gpu_address;
assert(rdst->bo_alignment == rsrc->bo_alignment);
assert(rdst->domains == rsrc->domains);
- si_rebind_buffer(ctx, dst, old_gpu_address);
+ si_rebind_buffer(sctx, dst, old_gpu_address);
}
static void si_invalidate_resource(struct pipe_context *ctx,
sctx->descriptors_dirty |= 1u << SI_DESCS_RW_BUFFERS;
}
-static void si_desc_reset_buffer_offset(struct pipe_context *ctx,
- uint32_t *desc, uint64_t old_buf_va,
+static void si_desc_reset_buffer_offset(uint32_t *desc, uint64_t old_buf_va,
struct pipe_resource *new_buf)
{
/* Retrieve the buffer offset from the descriptor. */
while (mask) {
unsigned i = u_bit_scan(&mask);
if (buffers->buffers[i] == buf) {
- si_desc_reset_buffer_offset(&sctx->b.b,
- descs->list + i*4,
+ si_desc_reset_buffer_offset(descs->list + i*4,
old_va, buf);
sctx->descriptors_dirty |= 1u << descriptors_idx;
/* Update all resource bindings where the buffer is bound, including
* all resource descriptors. This is invalidate_buffer without
* the invalidation. */
-void si_rebind_buffer(struct pipe_context *ctx, struct pipe_resource *buf,
+void si_rebind_buffer(struct si_context *sctx, struct pipe_resource *buf,
uint64_t old_va)
{
- struct si_context *sctx = (struct si_context*)ctx;
struct r600_resource *rbuffer = r600_resource(buf);
unsigned i, shader;
unsigned num_elems = sctx->vertex_elements ?
if (buffers->buffers[i] != buf)
continue;
- si_desc_reset_buffer_offset(ctx, descs->list + i*4,
+ si_desc_reset_buffer_offset(descs->list + i*4,
old_va, buf);
sctx->descriptors_dirty |= 1u << SI_DESCS_RW_BUFFERS;
if (samplers->views[i]->texture == buf) {
unsigned desc_slot = si_get_sampler_slot(i);
- si_desc_reset_buffer_offset(ctx,
- descs->list +
+ si_desc_reset_buffer_offset(descs->list +
desc_slot * 16 + 4,
old_va, buf);
sctx->descriptors_dirty |=
si_mark_image_range_valid(&images->views[i]);
si_desc_reset_buffer_offset(
- ctx, descs->list + desc_slot * 8 + 4,
+ descs->list + desc_slot * 8 + 4,
old_va, buf);
sctx->descriptors_dirty |=
1u << si_sampler_and_image_descriptors_idx(shader);