mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-12-03 23:24:17 +08:00
lavapipe: add command debugging
I keep adding this in locally. it's great for debugging Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21814>
This commit is contained in:
parent
e6e1d01be0
commit
c28c995645
@ -1607,6 +1607,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDevice(
|
|||||||
|
|
||||||
device->queue.state = device + 1;
|
device->queue.state = device + 1;
|
||||||
device->poison_mem = debug_get_bool_option("LVP_POISON_MEMORY", false);
|
device->poison_mem = debug_get_bool_option("LVP_POISON_MEMORY", false);
|
||||||
|
device->print_cmds = debug_get_bool_option("LVP_CMD_DEBUG", false);
|
||||||
|
|
||||||
struct vk_device_dispatch_table dispatch_table;
|
struct vk_device_dispatch_table dispatch_table;
|
||||||
vk_device_dispatch_table_from_entrypoints(&dispatch_table,
|
vk_device_dispatch_table_from_entrypoints(&dispatch_table,
|
||||||
|
@ -2709,14 +2709,14 @@ static void handle_push_constants(struct vk_cmd_queue_entry *cmd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void lvp_execute_cmd_buffer(struct lvp_cmd_buffer *cmd_buffer,
|
static void lvp_execute_cmd_buffer(struct lvp_cmd_buffer *cmd_buffer,
|
||||||
struct rendering_state *state);
|
struct rendering_state *state, bool print_cmds);
|
||||||
|
|
||||||
static void handle_execute_commands(struct vk_cmd_queue_entry *cmd,
|
static void handle_execute_commands(struct vk_cmd_queue_entry *cmd,
|
||||||
struct rendering_state *state)
|
struct rendering_state *state, bool print_cmds)
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i < cmd->u.execute_commands.command_buffer_count; i++) {
|
for (unsigned i = 0; i < cmd->u.execute_commands.command_buffer_count; i++) {
|
||||||
LVP_FROM_HANDLE(lvp_cmd_buffer, secondary_buf, cmd->u.execute_commands.command_buffers[i]);
|
LVP_FROM_HANDLE(lvp_cmd_buffer, secondary_buf, cmd->u.execute_commands.command_buffers[i]);
|
||||||
lvp_execute_cmd_buffer(secondary_buf, state);
|
lvp_execute_cmd_buffer(secondary_buf, state, print_cmds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4001,13 +4001,15 @@ void lvp_add_enqueue_cmd_entrypoints(struct vk_device_dispatch_table *disp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void lvp_execute_cmd_buffer(struct lvp_cmd_buffer *cmd_buffer,
|
static void lvp_execute_cmd_buffer(struct lvp_cmd_buffer *cmd_buffer,
|
||||||
struct rendering_state *state)
|
struct rendering_state *state, bool print_cmds)
|
||||||
{
|
{
|
||||||
struct vk_cmd_queue_entry *cmd;
|
struct vk_cmd_queue_entry *cmd;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
bool did_flush = false;
|
bool did_flush = false;
|
||||||
|
|
||||||
LIST_FOR_EACH_ENTRY(cmd, &cmd_buffer->vk.cmd_queue.cmds, cmd_link) {
|
LIST_FOR_EACH_ENTRY(cmd, &cmd_buffer->vk.cmd_queue.cmds, cmd_link) {
|
||||||
|
if (print_cmds)
|
||||||
|
fprintf(stderr, "%s\n", vk_cmd_queue_type_names[cmd->type]);
|
||||||
switch (cmd->type) {
|
switch (cmd->type) {
|
||||||
case VK_CMD_BIND_PIPELINE:
|
case VK_CMD_BIND_PIPELINE:
|
||||||
handle_pipeline(cmd, state);
|
handle_pipeline(cmd, state);
|
||||||
@ -4154,7 +4156,7 @@ static void lvp_execute_cmd_buffer(struct lvp_cmd_buffer *cmd_buffer,
|
|||||||
handle_push_constants(cmd, state);
|
handle_push_constants(cmd, state);
|
||||||
break;
|
break;
|
||||||
case VK_CMD_EXECUTE_COMMANDS:
|
case VK_CMD_EXECUTE_COMMANDS:
|
||||||
handle_execute_commands(cmd, state);
|
handle_execute_commands(cmd, state, print_cmds);
|
||||||
break;
|
break;
|
||||||
case VK_CMD_DRAW_INDIRECT_COUNT:
|
case VK_CMD_DRAW_INDIRECT_COUNT:
|
||||||
emit_state(state);
|
emit_state(state);
|
||||||
@ -4344,7 +4346,7 @@ VkResult lvp_execute_cmds(struct lvp_device *device,
|
|||||||
state->cso_ss_ptr[s][i] = &state->ss[s][i];
|
state->cso_ss_ptr[s][i] = &state->ss[s][i];
|
||||||
}
|
}
|
||||||
/* create a gallium context */
|
/* create a gallium context */
|
||||||
lvp_execute_cmd_buffer(cmd_buffer, state);
|
lvp_execute_cmd_buffer(cmd_buffer, state, device->print_cmds);
|
||||||
|
|
||||||
state->start_vb = -1;
|
state->start_vb = -1;
|
||||||
state->num_vb = 0;
|
state->num_vb = 0;
|
||||||
|
@ -181,6 +181,7 @@ struct lvp_device {
|
|||||||
struct pipe_screen *pscreen;
|
struct pipe_screen *pscreen;
|
||||||
void *noop_fs;
|
void *noop_fs;
|
||||||
bool poison_mem;
|
bool poison_mem;
|
||||||
|
bool print_cmds;
|
||||||
};
|
};
|
||||||
|
|
||||||
void lvp_device_get_cache_uuid(void *uuid);
|
void lvp_device_get_cache_uuid(void *uuid);
|
||||||
|
Loading…
Reference in New Issue
Block a user