Unverified Commit 2d3cf1b5 authored by Joshua Ashton's avatar Joshua Ashton 🐸
Browse files

blah blah big poopie

parent 12bc053b
Pipeline #406046 waiting for manual action with stages
......@@ -35,6 +35,7 @@ radv_GetAccelerationStructureBuildSizesKHR(
const VkAccelerationStructureBuildGeometryInfoKHR *pBuildInfo,
const uint32_t *pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR *pSizeInfo)
{
fprintf(stderr, "radv_GetAccelerationStructureBuildSizesKHR\n");
uint64_t triangles = 0, boxes = 0, instances = 0;
STATIC_ASSERT(sizeof(struct radv_bvh_triangle_node) == 64);
......@@ -90,6 +91,7 @@ radv_CreateAccelerationStructureKHR(VkDevice _device,
const VkAllocationCallbacks *pAllocator,
VkAccelerationStructureKHR *pAccelerationStructure)
{
fprintf(stderr, "radv_CreateAccelerationStructureKHR\n");
RADV_FROM_HANDLE(radv_device, device, _device);
RADV_FROM_HANDLE(radv_buffer, buffer, pCreateInfo->buffer);
struct radv_acceleration_structure *accel;
......@@ -114,6 +116,7 @@ radv_DestroyAccelerationStructureKHR(VkDevice _device,
VkAccelerationStructureKHR accelerationStructure,
const VkAllocationCallbacks *pAllocator)
{
fprintf(stderr, "radv_DestroyAccelerationStructureKHR\n");
RADV_FROM_HANDLE(radv_device, device, _device);
RADV_FROM_HANDLE(radv_acceleration_structure, accel, accelerationStructure);
......@@ -138,6 +141,7 @@ radv_WriteAccelerationStructuresPropertiesKHR(
const VkAccelerationStructureKHR *pAccelerationStructures, VkQueryType queryType,
size_t dataSize, void *pData, size_t stride)
{
fprintf(stderr, "radv_WriteAccelerationStructuresPropertiesKHR\n");
RADV_FROM_HANDLE(radv_device, device, _device);
char *data_out = (char*)pData;
......@@ -661,10 +665,14 @@ radv_BuildAccelerationStructuresKHR(
RADV_FROM_HANDLE(radv_device, device, _device);
VkResult result = VK_SUCCESS;
fprintf(stderr, "radv_BuildAccelerationStructuresKHR\n");
for (uint32_t i = 0; i < infoCount; ++i) {
result = build_bvh(device, pInfos + i, ppBuildRangeInfos[i]);
if (result != VK_SUCCESS)
if (result != VK_SUCCESS) {
fprintf(stderr, "oh no\n");
break;
}
}
return result;
}
......@@ -673,6 +681,7 @@ VkResult
radv_CopyAccelerationStructureKHR(VkDevice _device, VkDeferredOperationKHR deferredOperation,
const VkCopyAccelerationStructureInfoKHR *pInfo)
{
fprintf(stderr, "radv_CopyAccelerationStructureKHR\n");
RADV_FROM_HANDLE(radv_device, device, _device);
RADV_FROM_HANDLE(radv_acceleration_structure, src_struct, pInfo->src);
RADV_FROM_HANDLE(radv_acceleration_structure, dst_struct, pInfo->dst);
......@@ -1757,6 +1766,7 @@ radv_CmdBuildAccelerationStructuresKHR(
const VkAccelerationStructureBuildGeometryInfoKHR *pInfos,
const VkAccelerationStructureBuildRangeInfoKHR *const *ppBuildRangeInfos)
{
fprintf(stderr, "radv_CmdBuildAccelerationStructuresKHR\n");
RADV_FROM_HANDLE(radv_cmd_buffer, cmd_buffer, commandBuffer);
struct radv_meta_saved_state saved_state;
......@@ -1826,6 +1836,7 @@ radv_CmdBuildAccelerationStructuresKHR(
unreachable("Unknown geometryType");
}
printf("prim_consts: %d\n", (int)sizeof(prim_consts));
radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
cmd_buffer->device->meta_state.accel_struct_build.leaf_p_layout,
VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(prim_consts),
......@@ -1876,6 +1887,7 @@ radv_CmdBuildAccelerationStructuresKHR(
.fill_header = bvh_states[i].node_count | (final_iter ? 0x80000000U : 0),
};
printf("consts: %d\n", (int)sizeof(consts));
radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
cmd_buffer->device->meta_state.accel_struct_build.internal_p_layout,
VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(consts), &consts);
......
......@@ -3503,6 +3503,8 @@ radv_EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *p
return vk_error(NULL, VK_ERROR_LAYER_NOT_PRESENT);
}
VkQueue global_hack_queue;
void
radv_GetDeviceQueue2(VkDevice _device, const VkDeviceQueueInfo2 *pQueueInfo, VkQueue *pQueue)
{
......@@ -3523,6 +3525,7 @@ radv_GetDeviceQueue2(VkDevice _device, const VkDeviceQueueInfo2 *pQueueInfo, VkQ
return;
}
global_hack_queue = radv_queue_to_handle(queue);;
*pQueue = radv_queue_to_handle(queue);
}
......
......@@ -374,6 +374,31 @@ radv_CmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer,
pCopyImageToBufferInfo->srcImageLayout,
&pCopyImageToBufferInfo->pRegions[r]);
}
radv_EndCommandBuffer( (VkCommandBuffer)commandBuffer );
extern VkQueue global_hack_queue;
radv_DeviceWaitIdle((VkDevice)cmd_buffer->device);
VkSubmitInfo ggyugfsdsadadasd1 =
{
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
.commandBufferCount = 1,
.pCommandBuffers = &commandBuffer,
};
radv_QueueSubmit(global_hack_queue, 1, &ggyugfsdsadadasd1, VK_NULL_HANDLE);
radv_DeviceWaitIdle((VkDevice)cmd_buffer->device);
void *data = cmd_buffer->device->ws->buffer_map(dst_buffer->bo);
FILE *file = fopen("blah.values", "w");
if (file)
fwrite(data, sizeof(uint32_t), 8 * 8, file);
VkCommandBufferBeginInfo begin_asdasd = {
.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO,
};
radv_BeginCommandBuffer( (VkCommandBuffer)commandBuffer, &begin_asdasd );
}
static void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment