mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
d3d12: Fix indexing of local_reference_state
Instead of manually indexing a single-dimensional array as 2-dimensional (and using the wrong stride for the outer array) just actually make it a 2-dimensional array. Fixes:7edae456("d3d12: Track up to 16 contexts worth of batch references locally in bos") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24041> (cherry picked from commita6740ee7a4)
This commit is contained in:
parent
28f046d189
commit
9409ec0332
3 changed files with 5 additions and 5 deletions
|
|
@ -2479,7 +2479,7 @@
|
|||
"description": "d3d12: Fix indexing of local_reference_state",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "7edae456e2c64d0328037c42b61fd829e29c97c2"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -281,7 +281,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;
|
||||
|
|
@ -304,9 +304,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);
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue