Lines Matching defs:device_data

62 struct device_data {
84 struct device_data *device;
100 struct device_data *device;
131 struct device_data *device;
216 #define FIND_DEVICE_DATA(obj) ((struct device_data *)find_object_data(HKEY(obj)))
361 static struct device_data *new_device_data(VkDevice device, struct instance_data *instance)
363 struct device_data *data = rzalloc(NULL, struct device_data);
373 struct device_data *device_data)
375 struct queue_data *data = rzalloc(device_data, struct queue_data);
376 data->device = device_data;
388 VkResult err = device_data->vtable.CreateFence(device_data->device,
395 device_data->graphic_queue = data;
402 struct device_data *device_data = data->device;
403 device_data->vtable.DestroyFence(device_data->device, data->queries_fence, NULL);
408 static void device_map_queues(struct device_data *data,
445 static void device_unmap_queues(struct device_data *data)
451 static void destroy_device_data(struct device_data *data)
463 struct device_data *device_data)
466 data->device = device_data;
486 struct device_data *device_data)
488 struct instance_data *instance_data = device_data->instance;
490 data->device = device_data;
506 struct device_data *device_data = data->device;
513 if (draw && device_data->vtable.GetFenceStatus(device_data->device, draw->fence) == VK_SUCCESS) {
515 VK_CHECK(device_data->vtable.ResetFences(device_data->device,
528 VK_CHECK(device_data->vtable.AllocateCommandBuffers(device_data->device,
531 VK_CHECK(device_data->set_device_loader_data(device_data->device,
537 VK_CHECK(device_data->vtable.CreateFence(device_data->device,
542 VK_CHECK(device_data->vtable.CreateSemaphore(device_data->device, &sem_info,
565 struct device_data *device_data = data->device;
566 struct instance_data *instance_data = device_data->instance;
577 data->frames_stats[f_idx].stats[s] += device_data->frame_stats.stats[s] + data->frame_stats.stats[s];
578 data->accumulated_stats.stats[s] += device_data->frame_stats.stats[s] + data->frame_stats.stats[s];
629 memset(&device_data->frame_stats, 0, sizeof(device_data->frame_stats));
630 memset(&data->frame_stats, 0, sizeof(device_data->frame_stats));
667 struct device_data *device_data = data->device;
668 struct instance_data *instance_data = device_data->instance;
695 struct device_data *device_data = data->device;
696 struct instance_data *instance_data = device_data->instance;
702 ImGui::Text("Device: %s", device_data->properties.deviceName);
771 static uint32_t vk_memory_type(struct device_data *data,
791 struct device_data *device_data = data->device;
804 VK_CHECK(device_data->vtable.CreateBuffer(device_data->device, &buffer_info,
807 device_data->vtable.GetBufferMemoryRequirements(device_data->device,
813 upload_alloc_info.memoryTypeIndex = vk_memory_type(device_data,
816 VK_CHECK(device_data->vtable.AllocateMemory(device_data->device,
820 VK_CHECK(device_data->vtable.BindBufferMemory(device_data->device,
826 VK_CHECK(device_data->vtable.MapMemory(device_data->device,
834 VK_CHECK(device_data->vtable.FlushMappedMemoryRanges(device_data->device, 1, range));
835 device_data->vtable.UnmapMemory(device_data->device,
850 device_data->vtable.CmdPipelineBarrier(command_buffer,
862 device_data->vtable.CmdCopyBufferToImage(command_buffer,
880 device_data->vtable.CmdPipelineBarrier(command_buffer,
892 static void CreateOrResizeBuffer(struct device_data *data,
933 struct device_data *device_data = data->device;
936 device_data->vtable.ResetCommandBuffer(draw->command_buffer, 0);
948 device_data->vtable.BeginCommandBuffer(draw->command_buffer, &buffer_begin_info);
969 imb.dstQueueFamilyIndex = device_data->graphic_queue->family_index;
970 device_data->vtable.CmdPipelineBarrier(draw->command_buffer,
978 device_data->vtable.CmdBeginRenderPass(draw->command_buffer, &render_pass_info,
985 CreateOrResizeBuffer(device_data,
992 CreateOrResizeBuffer(device_data,
1002 VK_CHECK(device_data->vtable.MapMemory(device_data->device, draw->vertex_buffer_mem,
1004 VK_CHECK(device_data->vtable.MapMemory(device_data->device, draw->index_buffer_mem,
1021 VK_CHECK(device_data->vtable.FlushMappedMemoryRanges(device_data->device, 2, range));
1022 device_data->vtable.UnmapMemory(device_data->device, draw->vertex_buffer_mem);
1023 device_data->vtable.UnmapMemory(device_data->device, draw->index_buffer_mem);
1026 device_data->vtable.CmdBindPipeline(draw->command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, data->pipeline);
1028 device_data->vtable.CmdBindDescriptorSets(draw->command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
1034 device_data->vtable.CmdBindVertexBuffers(draw->command_buffer, 0, 1, vertex_buffers, vertex_offset);
1035 device_data->vtable.CmdBindIndexBuffer(draw->command_buffer, draw->index_buffer, 0, VK_INDEX_TYPE_UINT16);
1045 device_data->vtable.CmdSetViewport(draw->command_buffer, 0, 1, &viewport);
1060 device_data->vtable.CmdPushConstants(draw->command_buffer, data->pipeline_layout,
1063 device_data->vtable.CmdPushConstants(draw->command_buffer, data->pipeline_layout,
1084 device_data->vtable.CmdSetScissor(draw->command_buffer, 0, 1, &scissor);
1087 device_data->vtable.CmdDrawIndexed(draw->command_buffer, pcmd->ElemCount, 1, idx_offset, vtx_offset, 0);
1094 device_data->vtable.CmdEndRenderPass(draw->command_buffer);
1109 imb.srcQueueFamilyIndex = device_data->graphic_queue->family_index;
1111 device_data->vtable.CmdPipelineBarrier(draw->command_buffer,
1119 device_data->vtable.EndCommandBuffer(draw->command_buffer);
1132 device_data->vtable.QueueSubmit(device_data->graphic_queue->queue, 1, &submit_info, draw->fence);
1146 struct device_data *device_data = data->device;
1154 VK_CHECK(device_data->vtable.CreateShaderModule(device_data->device,
1160 VK_CHECK(device_data->vtable.CreateShaderModule(device_data->device,
1175 VK_CHECK(device_data->vtable.CreateSampler(device_data->device, &sampler_info,
1187 VK_CHECK(device_data->vtable.CreateDescriptorPool(device_data->device,
1202 VK_CHECK(device_data->vtable.CreateDescriptorSetLayout(device_data->device,
1212 VK_CHECK(device_data->vtable.AllocateDescriptorSets(device_data->device,
1229 VK_CHECK(device_data->vtable.CreatePipelineLayout(device_data->device,
1329 device_data->vtable.CreateGraphicsPipelines(device_data->device, VK_NULL_HANDLE,
1333 device_data->vtable.DestroyShaderModule(device_data->device, vert_module, NULL);
1334 device_data->vtable.DestroyShaderModule(device_data->device, frag_module, NULL);
1356 VK_CHECK(device_data->vtable.CreateImage(device_data->device, &image_info,
1359 device_data->vtable.GetImageMemoryRequirements(device_data->device,
1364 image_alloc_info.memoryTypeIndex = vk_memory_type(device_data,
1367 VK_CHECK(device_data->vtable.AllocateMemory(device_data->device, &image_alloc_info,
1369 VK_CHECK(device_data->vtable.BindImageMemory(device_data->device,
1382 VK_CHECK(device_data->vtable.CreateImageView(device_data->device, &view_info,
1396 device_data->vtable.UpdateDescriptorSets(device_data->device, 1, write_desc, 0, NULL);
1412 struct device_data *device_data = data->device;
1446 VK_CHECK(device_data->vtable.CreateRenderPass(device_data->device,
1452 VK_CHECK(device_data->vtable.GetSwapchainImagesKHR(device_data->device,
1461 VK_CHECK(device_data->vtable.GetSwapchainImagesKHR(device_data->device,
1478 VK_CHECK(device_data->vtable.CreateImageView(device_data->device,
1495 VK_CHECK(device_data->vtable.CreateFramebuffer(device_data->device, &fb_info,
1503 cmd_buffer_pool_info.queueFamilyIndex = device_data->graphic_queue->family_index;
1504 VK_CHECK(device_data->vtable.CreateCommandPool(device_data->device,
1511 struct device_data *device_data = data->device;
1514 device_data->vtable.DestroySemaphore(device_data->device, draw->semaphore, NULL);
1515 device_data->vtable.DestroyFence(device_data->device, draw->fence, NULL);
1516 device_data->vtable.DestroyBuffer(device_data->device, draw->vertex_buffer, NULL);
1517 device_data->vtable.DestroyBuffer(device_data->device, draw->index_buffer, NULL);
1518 device_data->vtable.FreeMemory(device_data->device, draw->vertex_buffer_mem, NULL);
1519 device_data->vtable.FreeMemory(device_data->device, draw->index_buffer_mem, NULL);
1523 device_data->vtable.DestroyImageView(device_data->device, data->image_views[i], NULL);
1524 device_data->vtable.DestroyFramebuffer(device_data->device, data->framebuffers[i], NULL);
1527 device_data->vtable.DestroyRenderPass(device_data->device, data->render_pass, NULL);
1529 device_data->vtable.DestroyCommandPool(device_data->device, data->command_pool, NULL);
1531 device_data->vtable.DestroyPipeline(device_data->device, data->pipeline, NULL);
1532 device_data->vtable.DestroyPipelineLayout(device_data->device, data->pipeline_layout, NULL);
1534 device_data->vtable.DestroyDescriptorPool(device_data->device,
1536 device_data->vtable.DestroyDescriptorSetLayout(device_data->device,
1539 device_data->vtable.DestroySampler(device_data->device, data->font_sampler, NULL);
1540 device_data->vtable.DestroyImageView(device_data->device, data->font_image_view, NULL);
1541 device_data->vtable.DestroyImage(device_data->device, data->font_image, NULL);
1542 device_data->vtable.FreeMemory(device_data->device, data->font_mem, NULL);
1544 device_data->vtable.DestroyBuffer(device_data->device, data->upload_font_buffer, NULL);
1545 device_data->vtable.FreeMemory(device_data->device, data->upload_font_buffer_mem, NULL);
1577 struct device_data *device_data = FIND_DEVICE_DATA(device);
1578 VkResult result = device_data->vtable.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
1581 struct swapchain_data *swapchain_data = new_swapchain_data(*pSwapchain, device_data);
1603 struct device_data *device_data = queue_data->device;
1604 struct instance_data *instance_data = device_data->instance;
1607 device_data->frame_stats.stats[OVERLAY_PARAM_ENABLED_frame]++;
1613 VkResult err = device_data->vtable.ResetFences(device_data->device,
1616 err = device_data->vtable.QueueSubmit(queue, 0, NULL, queue_data->queries_fence);
1618 err = device_data->vtable.WaitForFences(device_data->device,
1631 device_data->vtable.GetQueryPoolResults(device_data->device,
1640 device_data->frame_stats.stats[i] += query_results[i - OVERLAY_PARAM_ENABLED_vertices];
1646 device_data->vtable.GetQueryPoolResults(device_data->device,
1655 device_data->frame_stats.stats[OVERLAY_PARAM_ENABLED_gpu_timing] +=
1657 device_data->properties.limits.timestampPeriod;
1722 struct device_data *device_data = swapchain_data->device;
1725 VkResult result = device_data->vtable.AcquireNextImageKHR(device, swapchain, timeout,
1741 struct device_data *device_data = swapchain_data->device;
1744 VkResult result = device_data->vtable.AcquireNextImage2KHR(device, pAcquireInfo, pImageIndex);
1762 struct device_data *device_data = cmd_buffer_data->device;
1763 device_data->vtable.CmdDraw(commandBuffer, vertexCount, instanceCount,
1777 struct device_data *device_data = cmd_buffer_data->device;
1778 device_data->vtable.CmdDrawIndexed(commandBuffer, indexCount, instanceCount,
1791 struct device_data *device_data = cmd_buffer_data->device;
1792 device_data->vtable.CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
1804 struct device_data *device_data = cmd_buffer_data->device;
1805 device_data->vtable.CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
1819 struct device_data *device_data = cmd_buffer_data->device;
1820 device_data->vtable.CmdDrawIndirectCountKHR(commandBuffer, buffer, offset,
1836 struct device_data *device_data = cmd_buffer_data->device;
1837 device_data->vtable.CmdDrawIndexedIndirectCountKHR(commandBuffer, buffer, offset,
1850 struct device_data *device_data = cmd_buffer_data->device;
1851 device_data->vtable.CmdDispatch(commandBuffer, groupCountX, groupCountY, groupCountZ);
1861 struct device_data *device_data = cmd_buffer_data->device;
1862 device_data->vtable.CmdDispatchIndirect(commandBuffer, buffer, offset);
1877 struct device_data *device_data = cmd_buffer_data->device;
1878 device_data->vtable.CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
1886 struct device_data *device_data = cmd_buffer_data->device;
1916 VkResult result = device_data->vtable.BeginCommandBuffer(commandBuffer, pBeginInfo);
1927 VkResult result = device_data->vtable.BeginCommandBuffer(commandBuffer, pBeginInfo);
1931 device_data->vtable.CmdResetQueryPool(commandBuffer,
1936 device_data->vtable.CmdResetQueryPool(commandBuffer,
1941 device_data->vtable.CmdBeginQuery(commandBuffer,
1946 device_data->vtable.CmdWriteTimestamp(commandBuffer,
1960 struct device_data *device_data = cmd_buffer_data->device;
1963 device_data->vtable.CmdWriteTimestamp(commandBuffer,
1969 device_data->vtable.CmdEndQuery(commandBuffer,
1974 return device_data->vtable.EndCommandBuffer(commandBuffer);
1982 struct device_data *device_data = cmd_buffer_data->device;
1986 return device_data->vtable.ResetCommandBuffer(commandBuffer, flags);
1995 struct device_data *device_data = cmd_buffer_data->device;
2005 device_data->vtable.CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
2013 struct device_data *device_data = FIND_DEVICE_DATA(device);
2015 device_data->vtable.AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
2021 if (device_data->instance->pipeline_statistics_enabled &&
2032 device_data->vtable.CreateQueryPool(device_data->device, &pool_info,
2036 if (device_data->instance->params.enabled[OVERLAY_PARAM_ENABLED_gpu_timing]) {
2046 device_data->vtable.CreateQueryPool(device_data->device, &pool_info,
2054 i, device_data);
2071 struct device_data *device_data = FIND_DEVICE_DATA(device);
2082 device_data->vtable.DestroyQueryPool(device_data->device,
2090 device_data->vtable.DestroyQueryPool(device_data->device,
2098 device_data->vtable.FreeCommandBuffers(device, commandPool,
2109 struct device_data *device_data = queue_data->device;
2111 device_data->frame_stats.stats[OVERLAY_PARAM_ENABLED_submit]++;
2120 device_data->frame_stats.stats[st] += cmd_buffer_data->stats.stats[st];
2139 return device_data->vtable.QueueSubmit(queue, submitCount, pSubmits, fence);
2178 struct device_data *device_data = new_device_data(*pDevice, instance_data);
2179 device_data->physical_device = physicalDevice;
2180 vk_load_device_commands(*pDevice, fpGetDeviceProcAddr, &device_data->vtable);
2182 instance_data->vtable.GetPhysicalDeviceProperties(device_data->physical_device,
2183 &device_data->properties);
2187 device_data->set_device_loader_data = load_data_info->u.pfnSetDeviceLoaderData;
2189 device_map_queues(device_data, pCreateInfo);
2198 struct device_data *device_data = FIND_DEVICE_DATA(device);
2199 device_unmap_queues(device_data);
2200 device_data->vtable.DestroyDevice(device, pAllocator);
2201 destroy_device_data(device_data);
2314 struct device_data *device_data = FIND_DEVICE_DATA(dev);
2315 if (device_data->vtable.GetDeviceProcAddr == NULL) return NULL;
2316 return device_data->vtable.GetDeviceProcAddr(dev, funcName);