nvk: Make dynamic cbuf indices relative to the descriptor set
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27048>
This commit is contained in:
committed by
Marge Bot
parent
e0d907f56f
commit
3197aff4e8
@@ -758,9 +758,12 @@ nvk_cmd_buffer_get_cbuf_descriptor(struct nvk_cmd_buffer *cmd,
|
||||
};
|
||||
return true;
|
||||
|
||||
case NVK_CBUF_TYPE_DYNAMIC_UBO:
|
||||
*desc_out = desc->root.dynamic_buffers[cbuf->dynamic_idx];
|
||||
case NVK_CBUF_TYPE_DYNAMIC_UBO: {
|
||||
const uint32_t dyn_start =
|
||||
desc->root.set_dynamic_buffer_start[cbuf->desc_set];
|
||||
*desc_out = desc->root.dynamic_buffers[dyn_start + cbuf->dynamic_idx];
|
||||
return true;
|
||||
}
|
||||
|
||||
case NVK_CBUF_TYPE_UBO_DESC: {
|
||||
if (desc->sets[cbuf->desc_set] != NULL)
|
||||
|
||||
@@ -291,17 +291,14 @@ ubo_deref_to_cbuf(nir_deref_instr *deref,
|
||||
}
|
||||
|
||||
case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC: {
|
||||
uint8_t dynamic_buffer_index =
|
||||
nvk_descriptor_set_layout_dynbuf_start(ctx->layout, set) +
|
||||
binding_layout->dynamic_buffer_index + index;
|
||||
|
||||
*offset_out = 0;
|
||||
*start_out = offset;
|
||||
*end_out = offset + range;
|
||||
|
||||
return (struct nvk_cbuf) {
|
||||
.type = NVK_CBUF_TYPE_DYNAMIC_UBO,
|
||||
.dynamic_idx = dynamic_buffer_index,
|
||||
.desc_set = set,
|
||||
.dynamic_idx = binding_layout->dynamic_buffer_index + index,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user