anv: Add flush reasons to raytracing flushes

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21505>
This commit is contained in:
Felix DeGrood
2023-02-22 21:33:13 +00:00
committed by Marge Bot
parent 9a30493ccb
commit bdeb849e25
2 changed files with 24 additions and 8 deletions
+21 -7
View File
@@ -835,7 +835,9 @@ cmd_build_acceleration_structures(
transient_mem_init_globals_offset),
infoCount);
cmd_buffer->state.pending_pipe_bits |= ANV_GRL_FLUSH_FLAGS;
anv_add_pending_pipe_bits(cmd_buffer,
ANV_GRL_FLUSH_FLAGS,
"building accel struct");
/* Round 2 : Copy instance/geometry data from the application provided
* buffers into the acceleration structures.
@@ -949,7 +951,9 @@ cmd_build_acceleration_structures(
}
}
cmd_buffer->state.pending_pipe_bits |= ANV_GRL_FLUSH_FLAGS;
anv_add_pending_pipe_bits(cmd_buffer,
ANV_GRL_FLUSH_FLAGS,
"building accel struct");
/* Dispatch trivial builds */
if (num_trivial_builds) {
@@ -1023,7 +1027,9 @@ cmd_build_acceleration_structures(
}
if (num_new_sah_builds == 0)
cmd_buffer->state.pending_pipe_bits |= ANV_GRL_FLUSH_FLAGS;
anv_add_pending_pipe_bits(cmd_buffer,
ANV_GRL_FLUSH_FLAGS,
"building accel struct");
/* Finally write the leaves. */
for (uint32_t i = 0; i < infoCount; i++) {
@@ -1078,7 +1084,9 @@ cmd_build_acceleration_structures(
}
}
cmd_buffer->state.pending_pipe_bits |= ANV_GRL_FLUSH_FLAGS;
anv_add_pending_pipe_bits(cmd_buffer,
ANV_GRL_FLUSH_FLAGS,
"building accel struct");
error:
vk_free(&cmd_buffer->device->vk.alloc, builds);
@@ -1140,7 +1148,9 @@ genX(CmdCopyAccelerationStructureKHR)(
vk_acceleration_structure_get_va(src_accel));
}
cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_END_OF_PIPE_SYNC_BIT;
anv_add_pending_pipe_bits(cmd_buffer,
ANV_PIPE_END_OF_PIPE_SYNC_BIT,
"after copy acceleration struct");
}
void
@@ -1164,7 +1174,9 @@ genX(CmdCopyAccelerationStructureToMemoryKHR)(
anv_address_physical(device->rt_uuid_addr),
src_size_addr);
cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_END_OF_PIPE_SYNC_BIT;
anv_add_pending_pipe_bits(cmd_buffer,
ANV_PIPE_END_OF_PIPE_SYNC_BIT,
"after copy acceleration struct");
}
void
@@ -1185,7 +1197,9 @@ genX(CmdCopyMemoryToAccelerationStructureKHR)(
pInfo->src.deviceAddress,
src_size_addr);
cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_END_OF_PIPE_SYNC_BIT;
anv_add_pending_pipe_bits(cmd_buffer,
ANV_PIPE_END_OF_PIPE_SYNC_BIT,
"after copy acceleration struct");
}
/* TODO: Host commands */
+3 -1
View File
@@ -1688,7 +1688,9 @@ genX(CmdWriteAccelerationStructuresPropertiesKHR)(
}
}
cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_END_OF_PIPE_SYNC_BIT;
anv_add_pending_pipe_bits(cmd_buffer,
ANV_PIPE_END_OF_PIPE_SYNC_BIT,
"after write acceleration struct props");
genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);
for (uint32_t i = 0; i < accelerationStructureCount; i++)