nvk: Add a root_desc_addr to the root descriptor table
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24326>
This commit is contained in:
parent
2e709a9278
commit
0241ed6025
3 changed files with 18 additions and 9 deletions
|
|
@ -21,18 +21,19 @@ struct nvk_push_descriptor_set;
|
|||
|
||||
/** Root descriptor table. This gets pushed to the GPU directly */
|
||||
struct nvk_root_descriptor_table {
|
||||
uint64_t root_desc_addr;
|
||||
|
||||
union {
|
||||
struct {
|
||||
uint32_t base_vertex;
|
||||
uint32_t base_instance;
|
||||
uint32_t draw_id;
|
||||
uint32_t view_index;
|
||||
uint32_t _pad[4];
|
||||
uint32_t _pad[2];
|
||||
} draw;
|
||||
struct {
|
||||
uint32_t base_group[3];
|
||||
uint32_t group_count[3];
|
||||
uint32_t _pad[2];
|
||||
} cs;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -148,14 +148,18 @@ nvk_flush_compute_state(struct nvk_cmd_buffer *cmd,
|
|||
*/
|
||||
STATIC_ASSERT((sizeof(desc->root) & 0xff) == 0);
|
||||
|
||||
void *root_desc_map;
|
||||
uint64_t root_desc_addr;
|
||||
result = nvk_cmd_buffer_upload_data(cmd, &desc->root, sizeof(desc->root),
|
||||
0x100, &root_desc_addr);
|
||||
result = nvk_cmd_buffer_upload_alloc(cmd, sizeof(desc->root), 0x100,
|
||||
&root_desc_addr, &root_desc_map);
|
||||
if (unlikely(result != VK_SUCCESS)) {
|
||||
vk_command_buffer_set_error(&cmd->vk, result);
|
||||
return 0;
|
||||
}
|
||||
|
||||
desc->root.root_desc_addr = root_desc_addr;
|
||||
memcpy(root_desc_map, &desc->root, sizeof(desc->root));
|
||||
|
||||
uint32_t qmd[128];
|
||||
memset(qmd, 0, sizeof(qmd));
|
||||
memcpy(qmd, pipeline->qmd_template, sizeof(pipeline->qmd_template));
|
||||
|
|
|
|||
|
|
@ -1393,20 +1393,24 @@ nvk_flush_descriptors(struct nvk_cmd_buffer *cmd)
|
|||
*/
|
||||
STATIC_ASSERT((sizeof(desc->root) & 0xff) == 0);
|
||||
|
||||
uint64_t root_table_addr;
|
||||
result = nvk_cmd_buffer_upload_data(cmd, &desc->root, sizeof(desc->root),
|
||||
0x100, &root_table_addr);
|
||||
void *root_desc_map;
|
||||
uint64_t root_desc_addr;
|
||||
result = nvk_cmd_buffer_upload_alloc(cmd, sizeof(desc->root), 0x100,
|
||||
&root_desc_addr, &root_desc_map);
|
||||
if (unlikely(result != VK_SUCCESS)) {
|
||||
vk_command_buffer_set_error(&cmd->vk, result);
|
||||
return;
|
||||
}
|
||||
|
||||
desc->root.root_desc_addr = root_desc_addr;
|
||||
memcpy(root_desc_map, &desc->root, sizeof(desc->root));
|
||||
|
||||
struct nv_push *p = nvk_cmd_buffer_push(cmd, 26);
|
||||
|
||||
P_MTHD(p, NV9097, SET_CONSTANT_BUFFER_SELECTOR_A);
|
||||
P_NV9097_SET_CONSTANT_BUFFER_SELECTOR_A(p, sizeof(desc->root));
|
||||
P_NV9097_SET_CONSTANT_BUFFER_SELECTOR_B(p, root_table_addr >> 32);
|
||||
P_NV9097_SET_CONSTANT_BUFFER_SELECTOR_C(p, root_table_addr);
|
||||
P_NV9097_SET_CONSTANT_BUFFER_SELECTOR_B(p, root_desc_addr >> 32);
|
||||
P_NV9097_SET_CONSTANT_BUFFER_SELECTOR_C(p, root_desc_addr);
|
||||
|
||||
for (uint32_t i = 0; i < 5; i++) {
|
||||
P_IMMD(p, NV9097, BIND_GROUP_CONSTANT_BUFFER(i), {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue