mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 15:58:05 +02:00
nvk: Don't use a descriptor cbuf if it's too large
This fixes a test on vkd3d-proton commit 836446ce25 VKD3D_TEST_FILTER=test_typed_buffers_many_objects_dxil build/tests/d3d12 Fixes:f1c909edd5("nvk/nir: Add cbuf analysis to nvi_nir_lower_descriptors()") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28844> (cherry picked from commit6b22fff658)
This commit is contained in:
parent
a6d4353291
commit
5345aceffa
2 changed files with 5 additions and 2 deletions
|
|
@ -524,7 +524,7 @@
|
|||
"description": "nvk: Don't use a descriptor cbuf if it's too large",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "f1c909edd5c9159609ab27e7b6a7374796cceab3",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -581,6 +581,9 @@ load_descriptor(nir_builder *b, unsigned num_components, unsigned bit_size,
|
|||
nir_iadd_imm(b, nir_imul_imm(b, index, binding_layout->stride),
|
||||
binding_layout->offset + offset_B);
|
||||
|
||||
uint64_t max_desc_ubo_offset = binding_layout->offset +
|
||||
binding_layout->array_size * binding_layout->stride;
|
||||
|
||||
unsigned desc_align_mul = (1 << (ffs(binding_layout->stride) - 1));
|
||||
desc_align_mul = MIN2(desc_align_mul, 16);
|
||||
unsigned desc_align_offset = binding_layout->offset + offset_B;
|
||||
|
|
@ -593,7 +596,7 @@ load_descriptor(nir_builder *b, unsigned num_components, unsigned bit_size,
|
|||
int cbuf_idx = get_mapped_cbuf_idx(&cbuf_key, ctx);
|
||||
|
||||
nir_def *desc;
|
||||
if (cbuf_idx >= 0) {
|
||||
if (cbuf_idx >= 0 && max_desc_ubo_offset <= NVK_MAX_CBUF_SIZE) {
|
||||
desc = nir_load_ubo(b, num_components, bit_size,
|
||||
nir_imm_int(b, cbuf_idx),
|
||||
desc_ubo_offset,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue