anv: Split GRL code path in separate file

Rework (Kevin)
- Remove genX_acceleration_structure.c from meson option to avoid
  linking error

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31588>
This commit is contained in:
Sagar Ghuge 2024-06-04 15:38:45 -07:00 committed by Marge Bot
parent b002b2589c
commit 617b7602ea
4 changed files with 1301 additions and 1133 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2017,8 +2017,8 @@ void genX(CmdCopyQueryPoolResults)(
#include "grl/include/GRLRTASCommon.h"
#include "grl/grl_metakernel_postbuild_info.h"
void
genX(CmdWriteAccelerationStructuresPropertiesKHR)(
static void
anv_write_acceleration_structure_properties_grl(
VkCommandBuffer commandBuffer,
uint32_t accelerationStructureCount,
const VkAccelerationStructureKHR* pAccelerationStructures,
@ -2029,11 +2029,6 @@ genX(CmdWriteAccelerationStructuresPropertiesKHR)(
ANV_FROM_HANDLE(anv_cmd_buffer, cmd_buffer, commandBuffer);
ANV_FROM_HANDLE(anv_query_pool, pool, queryPool);
assert(queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR ||
queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR ||
queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR ||
queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR);
emit_query_clear_flush(cmd_buffer, pool,
"CmdWriteAccelerationStructuresPropertiesKHR flush query clears");
@ -2082,4 +2077,25 @@ genX(CmdWriteAccelerationStructuresPropertiesKHR)(
for (uint32_t i = 0; i < accelerationStructureCount; i++)
emit_query_mi_availability(&b, anv_query_address(pool, firstQuery + i), true);
}
void
genX(CmdWriteAccelerationStructuresPropertiesKHR)(
VkCommandBuffer commandBuffer,
uint32_t accelerationStructureCount,
const VkAccelerationStructureKHR* pAccelerationStructures,
VkQueryType queryType,
VkQueryPool queryPool,
uint32_t firstQuery)
{
assert(queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_COMPACTED_SIZE_KHR ||
queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_SIZE_KHR ||
queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR ||
queryType == VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR);
anv_write_acceleration_structure_properties_grl(commandBuffer,
accelerationStructureCount,
pAccelerationStructures,
queryType, queryPool,
firstQuery);
}
#endif

View file

@ -101,7 +101,9 @@ anv_per_hw_ver_files = files(
'genX_simple_shader.c',
)
if with_intel_vk_rt
anv_per_hw_ver_files += files('genX_acceleration_structure.c',)
anv_per_hw_ver_files += files(
'genX_acceleration_structure_grl.c',
)
endif
foreach _gfx_ver : ['90', '110', '120', '125', '200', '300']