nvk: Implement CmdProcess/ExecuteGeneratedCommandsEXT

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31394>
This commit is contained in:
Faith Ekstrand 2024-08-22 13:22:41 -05:00 committed by Marge Bot
parent 78e0adbfe1
commit 976f22a5da
3 changed files with 1122 additions and 2 deletions

View file

@ -13,6 +13,7 @@ nvk_files = files(
'nvk_cmd_copy.c',
'nvk_cmd_dispatch.c',
'nvk_cmd_draw.c',
'nvk_cmd_indirect.c',
'nvk_cmd_meta.c',
'nvk_cmd_pool.c',
'nvk_cmd_pool.h',

View file

@ -198,7 +198,7 @@ struct nvk_cmd_push {
struct nvk_cmd_buffer {
struct vk_command_buffer vk;
struct {
struct nvk_cmd_state {
uint64_t descriptor_buffers[NVK_MAX_SETS];
struct nvk_graphics_state gfx;
struct nvk_compute_state cs;
@ -311,7 +311,22 @@ nvk_get_descriptors_state(struct nvk_cmd_buffer *cmd,
default:
unreachable("Unhandled bind point");
}
};
}
static inline struct nvk_descriptor_state *
nvk_get_descriptor_state_for_stages(struct nvk_cmd_buffer *cmd,
VkShaderStageFlags stages)
{
if (stages & VK_SHADER_STAGE_COMPUTE_BIT) {
assert(stages == VK_SHADER_STAGE_COMPUTE_BIT);
return &cmd->state.cs.descriptors;
} else if (stages & NVK_SHADER_STAGE_GRAPHICS_BITS) {
assert(!(stages & ~NVK_SHADER_STAGE_GRAPHICS_BITS));
return &cmd->state.gfx.descriptors;
} else {
unreachable("Unknown shader stage");
}
}
VkResult nvk_cmd_buffer_upload_alloc(struct nvk_cmd_buffer *cmd,
uint32_t size, uint32_t alignment,

File diff suppressed because it is too large Load diff