lavapipe: plumb print_cmds through NV DGC

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29293>
This commit is contained in:
Mike Blumenkrantz
2024-04-18 13:07:27 -04:00
committed by Marge Bot
parent 42e3d580cc
commit aaa3f37ae5
+9 -5
View File
@@ -3922,9 +3922,10 @@ static size_t
process_sequence(struct rendering_state *state,
VkPipeline pipeline, struct lvp_indirect_command_layout *dlayout,
struct list_head *list, uint8_t *pbuf, size_t max_size,
uint8_t **map_streams, const VkIndirectCommandsStreamNV *pstreams, uint32_t seq)
uint8_t **map_streams, const VkIndirectCommandsStreamNV *pstreams, uint32_t seq, bool print_cmds)
{
size_t size = 0;
for (uint32_t t = 0; t < dlayout->token_count; t++){
const VkIndirectCommandsLayoutTokenNV *token = &dlayout->tokens[t];
uint32_t stride = dlayout->stream_strides[token->stream];
@@ -3937,6 +3938,9 @@ process_sequence(struct rendering_state *state,
size_t cmd_size = vk_cmd_queue_type_sizes[lvp_nv_dgc_token_to_cmd_type(token)];
uint8_t *cmdptr = (void*)(pbuf + size + cmd_size);
if (print_cmds)
fprintf(stderr, "DGC %s\n", vk_IndirectCommandsTokenTypeNV_to_str(token->tokenType));
if (max_size < size + cmd_size)
abort();
cmd->type = lvp_nv_dgc_token_to_cmd_type(token);
@@ -4061,7 +4065,7 @@ process_sequence(struct rendering_state *state,
}
static void
handle_preprocess_generated_commands(struct vk_cmd_queue_entry *cmd, struct rendering_state *state)
handle_preprocess_generated_commands(struct vk_cmd_queue_entry *cmd, struct rendering_state *state, bool print_cmds)
{
VkGeneratedCommandsInfoNV *pre = cmd->u.preprocess_generated_commands_nv.generated_commands_info;
VK_FROM_HANDLE(lvp_indirect_command_layout, dlayout, pre->indirectCommandsLayout);
@@ -4102,7 +4106,7 @@ handle_preprocess_generated_commands(struct vk_cmd_queue_entry *cmd, struct rend
size_t offset = size;
for (unsigned i = 0; i < seq_count; i++) {
uint32_t s = seq ? seq[i] : i;
offset += process_sequence(state, pre->pipeline, dlayout, list, p + offset, max_size, streams, pre->pStreams, s);
offset += process_sequence(state, pre->pipeline, dlayout, list, p + offset, max_size, streams, pre->pStreams, s, print_cmds);
}
/* vk_cmd_queue will copy the binary and break the list, so null the tail pointer */
@@ -4123,7 +4127,7 @@ handle_execute_generated_commands(struct vk_cmd_queue_entry *cmd, struct renderi
if (!exec->is_preprocessed) {
struct vk_cmd_queue_entry pre;
pre.u.preprocess_generated_commands_nv.generated_commands_info = exec->generated_commands_info;
handle_preprocess_generated_commands(&pre, state);
handle_preprocess_generated_commands(&pre, state, print_cmds);
}
LVP_FROM_HANDLE(lvp_buffer, pbuf, gen->preprocessBuffer);
struct pipe_transfer *pmap;
@@ -5124,7 +5128,7 @@ static void lvp_execute_cmd_buffer(struct list_head *cmds,
handle_graphics_pipeline_group(cmd, state);
break;
case VK_CMD_PREPROCESS_GENERATED_COMMANDS_NV:
handle_preprocess_generated_commands(cmd, state);
handle_preprocess_generated_commands(cmd, state, print_cmds);
break;
case VK_CMD_EXECUTE_GENERATED_COMMANDS_NV:
handle_execute_generated_commands(cmd, state, print_cmds);