diff --git a/src/gallium/drivers/d3d12/d3d12_batch.cpp b/src/gallium/drivers/d3d12/d3d12_batch.cpp index 75ce88f4faf..6f578994ac6 100644 --- a/src/gallium/drivers/d3d12/d3d12_batch.cpp +++ b/src/gallium/drivers/d3d12/d3d12_batch.cpp @@ -284,7 +284,7 @@ d3d12_batch_get_reference(struct d3d12_batch *batch, { if (batch->ctx_id != D3D12_CONTEXT_NO_ID) { if ((bo->local_reference_mask[batch->ctx_id] & (1 << batch->ctx_index)) != 0) { - return &bo->local_reference_state[(batch->ctx_id * 16) + batch->ctx_index]; + return &bo->local_reference_state[batch->ctx_id][batch->ctx_index]; } else return NULL; @@ -307,9 +307,9 @@ d3d12_batch_acquire_reference(struct d3d12_batch *batch, d3d12_bo_reference(bo); util_dynarray_append(&batch->local_bos, d3d12_bo*, bo); bo->local_reference_mask[batch->ctx_id] |= (1 << batch->ctx_index); - bo->local_reference_state[(batch->ctx_id * 16) + batch->ctx_index] = batch_bo_reference_none; + bo->local_reference_state[batch->ctx_id][batch->ctx_index] = batch_bo_reference_none; } - return &bo->local_reference_state[(batch->ctx_id * 16) + batch->ctx_index]; + return &bo->local_reference_state[batch->ctx_id][batch->ctx_index]; } else { hash_entry* entry = _mesa_hash_table_search(batch->bos, bo); diff --git a/src/gallium/drivers/d3d12/d3d12_bufmgr.h b/src/gallium/drivers/d3d12/d3d12_bufmgr.h index 96d68bfd3b3..ee70fa6bde0 100644 --- a/src/gallium/drivers/d3d12/d3d12_bufmgr.h +++ b/src/gallium/drivers/d3d12/d3d12_bufmgr.h @@ -71,7 +71,7 @@ struct d3d12_bo { uint8_t local_reference_mask[16]; d3d12_context_state_table_entry local_context_states[16]; - uint8_t local_reference_state[128]; + uint8_t local_reference_state[8][16]; }; struct d3d12_buffer {