aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-10-31 09:41:49 -0700
committerKenneth Graunke <[email protected]>2019-11-25 15:54:54 -0800
commit4c1f81ad6220db86f49f33e034764db37523425e (patch)
tree03accfca465f969798f4de65d25e1374873169f8 /src/gallium/drivers
parent518be59c1ab3b7bab207d01b38512056e10314a7 (diff)
iris: Drop 'old_address' parameter from iris_rebind_buffer
We can just compare the VERTEX_BUFFER_STATE address field to the current BO's address. When calling rebind, we've already updated the resource to the new buffer, but the state will have the old address.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/iris/iris_context.h3
-rw-r--r--src/gallium/drivers/iris/iris_resource.c2
-rw-r--r--src/gallium/drivers/iris/iris_state.c8
3 files changed, 6 insertions, 7 deletions
diff --git a/src/gallium/drivers/iris/iris_context.h b/src/gallium/drivers/iris/iris_context.h
index b83582658f3..b81cd30441a 100644
--- a/src/gallium/drivers/iris/iris_context.h
+++ b/src/gallium/drivers/iris/iris_context.h
@@ -432,8 +432,7 @@ struct iris_vtable {
struct iris_batch *batch,
const struct pipe_grid_info *grid);
void (*rebind_buffer)(struct iris_context *ice,
- struct iris_resource *res,
- uint64_t old_address);
+ struct iris_resource *res);
void (*resolve_conditional_render)(struct iris_context *ice);
void (*load_register_reg32)(struct iris_batch *batch, uint32_t dst,
uint32_t src);
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index df1bf0f7451..296d99ed810 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1265,7 +1265,7 @@ iris_invalidate_resource(struct pipe_context *ctx,
/* Rebind the buffer, replacing any state referring to the old BO's
* address, and marking state dirty so it's reemitted.
*/
- ice->vtbl.rebind_buffer(ice, res, old_bo->gtt_offset);
+ ice->vtbl.rebind_buffer(ice, res);
util_range_set_empty(&res->valid_buffer_range);
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index 4f615ee9060..37f1ae26c17 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -6368,8 +6368,7 @@ iris_destroy_state(struct iris_context *ice)
static void
iris_rebind_buffer(struct iris_context *ice,
- struct iris_resource *res,
- uint64_t old_address)
+ struct iris_resource *res)
{
struct pipe_context *ctx = &ice->ctx;
struct iris_screen *screen = (void *) ctx->screen;
@@ -6398,9 +6397,10 @@ iris_rebind_buffer(struct iris_context *ice,
STATIC_ASSERT(GENX(VERTEX_BUFFER_STATE_BufferStartingAddress_start) == 32);
STATIC_ASSERT(GENX(VERTEX_BUFFER_STATE_BufferStartingAddress_bits) == 64);
uint64_t *addr = (uint64_t *) &state->state[1];
+ struct iris_bo *bo = iris_resource_bo(state->resource);
- if (*addr == old_address + state->offset) {
- *addr = res->bo->gtt_offset + state->offset;
+ if (*addr != bo->gtt_offset + state->offset) {
+ *addr = bo->gtt_offset + state->offset;
ice->state.dirty |= IRIS_DIRTY_VERTEX_BUFFERS;
}
}