Don't use BeginQuery/EndQuery to initialise AS queries

This commit is contained in:
baldurk
2024-12-06 15:59:22 +00:00
parent 1e977fe889
commit 9703cf23e3
2 changed files with 22 additions and 1 deletions
+12 -1
View File
@@ -3749,11 +3749,22 @@ void WrappedVulkan::ApplyInitialContents()
for(uint32_t q = 0; q < r.queryCount; q++)
{
// Timestamps are easy - we can do these without needing to render
if(m_CreationInfo.m_QueryPool[GetResID(r.pool)].queryType == VK_QUERY_TYPE_TIMESTAMP)
VkQueryType queryType = m_CreationInfo.m_QueryPool[GetResID(r.pool)].queryType;
if(queryType == VK_QUERY_TYPE_TIMESTAMP)
{
ObjDisp(cmd)->CmdWriteTimestamp(Unwrap(cmd), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
Unwrap(r.pool), r.firstQuery + q);
}
else if(queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR ||
queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR ||
queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR)
{
/*
ObjDisp(cmd)->CmdWriteAccelerationStructuresPropertiesKHR(
Unwrap(commandBuffer), 1, UnwrapPtr(m_DummyQueryAS), CreateInfo.queryType,
Unwrap(pool), i);
*/
}
else
{
ObjDisp(cmd)->CmdBeginQuery(Unwrap(cmd), Unwrap(r.pool), r.firstQuery + q, 0);
@@ -1591,6 +1591,16 @@ bool WrappedVulkan::Serialise_vkCreateQueryPool(SerialiserType &ser, VkDevice de
ObjDisp(cmd)->CmdWriteTimestamp(Unwrap(cmd), VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
Unwrap(pool), i);
}
else if(CreateInfo.queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR ||
CreateInfo.queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR ||
CreateInfo.queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR)
{
/*
ObjDisp(cmd)->CmdWriteAccelerationStructuresPropertiesKHR(
Unwrap(commandBuffer), 1, UnwrapPtr(m_DummyQueryAS), CreateInfo.queryType,
Unwrap(pool), i);
*/
}
else
{
ObjDisp(cmd)->CmdBeginQuery(Unwrap(cmd), Unwrap(pool), i, 0);