Lines Matching defs:device_data
76 struct device_data {
98 struct device_data *device;
114 struct device_data *device;
147 struct device_data *device;
370 static struct device_data *new_device_data(VkDevice device, struct instance_data *instance)
372 struct device_data *data = rzalloc(NULL, struct device_data);
382 struct device_data *device_data)
384 struct queue_data *data = rzalloc(device_data, struct queue_data);
385 data->device = device_data;
397 VK_CHECK(device_data->vtable.CreateFence(device_data->device,
403 device_data->graphic_queue = data;
410 struct device_data *device_data = data->device;
411 device_data->vtable.DestroyFence(device_data->device, data->queries_fence, NULL);
416 static void device_map_queues(struct device_data *data,
453 static void device_unmap_queues(struct device_data *data)
459 static void destroy_device_data(struct device_data *data)
471 struct device_data *device_data)
474 data->device = device_data;
494 struct device_data *device_data)
496 struct instance_data *instance_data = device_data->instance;
498 data->device = device_data;
514 struct device_data *device_data = data->device;
521 if (draw && device_data->vtable.GetFenceStatus(device_data->device, draw->fence) == VK_SUCCESS) {
523 VK_CHECK(device_data->vtable.ResetFences(device_data->device,
536 VK_CHECK(device_data->vtable.AllocateCommandBuffers(device_data->device,
539 VK_CHECK(device_data->set_device_loader_data(device_data->device,
545 VK_CHECK(device_data->vtable.CreateFence(device_data->device,
550 VK_CHECK(device_data->vtable.CreateSemaphore(device_data->device, &sem_info,
552 VK_CHECK(device_data->vtable.CreateSemaphore(device_data->device, &sem_info,
682 static void control_send_connection_string(struct device_data *device_data)
684 struct instance_data *instance_data = device_data->instance;
693 const char *deviceName = device_data->properties.deviceName;
705 static void control_client_check(struct device_data *device_data)
707 struct instance_data *instance_data = device_data->instance;
723 control_send_connection_string(device_data);
774 struct device_data *device_data = data->device;
775 struct instance_data *instance_data = device_data->instance;
780 control_client_check(device_data);
791 data->frames_stats[f_idx].stats[s] += device_data->frame_stats.stats[s] + data->frame_stats.stats[s];
792 data->accumulated_stats.stats[s] += device_data->frame_stats.stats[s] + data->frame_stats.stats[s];
861 memset(&device_data->frame_stats, 0, sizeof(device_data->frame_stats));
862 memset(&data->frame_stats, 0, sizeof(device_data->frame_stats));
899 struct device_data *device_data = data->device;
900 struct instance_data *instance_data = device_data->instance;
927 struct device_data *device_data = data->device;
928 struct instance_data *instance_data = device_data->instance;
935 ImGui::Text("Device: %s", device_data->properties.deviceName);
1010 static uint32_t vk_memory_type(struct device_data *data,
1030 struct device_data *device_data = data->device;
1043 VK_CHECK(device_data->vtable.CreateBuffer(device_data->device, &buffer_info,
1046 device_data->vtable.GetBufferMemoryRequirements(device_data->device,
1052 upload_alloc_info.memoryTypeIndex = vk_memory_type(device_data,
1055 VK_CHECK(device_data->vtable.AllocateMemory(device_data->device,
1059 VK_CHECK(device_data->vtable.BindBufferMemory(device_data->device,
1065 VK_CHECK(device_data->vtable.MapMemory(device_data->device,
1073 VK_CHECK(device_data->vtable.FlushMappedMemoryRanges(device_data->device, 1, range));
1074 device_data->vtable.UnmapMemory(device_data->device,
1089 device_data->vtable.CmdPipelineBarrier(command_buffer,
1101 device_data->vtable.CmdCopyBufferToImage(command_buffer,
1119 device_data->vtable.CmdPipelineBarrier(command_buffer,
1131 static void CreateOrResizeBuffer(struct device_data *data,
1172 struct device_data *device_data = data->device;
1175 device_data->vtable.ResetCommandBuffer(draw->command_buffer, 0);
1187 device_data->vtable.BeginCommandBuffer(draw->command_buffer, &buffer_begin_info);
1208 imb.dstQueueFamilyIndex = device_data->graphic_queue->family_index;
1209 device_data->vtable.CmdPipelineBarrier(draw->command_buffer,
1217 device_data->vtable.CmdBeginRenderPass(draw->command_buffer, &render_pass_info,
1221 size_t vertex_size = ALIGN(draw_data->TotalVtxCount * sizeof(ImDrawVert), device_data->properties.limits.nonCoherentAtomSize);
1222 size_t index_size = ALIGN(draw_data->TotalIdxCount * sizeof(ImDrawIdx), device_data->properties.limits.nonCoherentAtomSize);
1224 CreateOrResizeBuffer(device_data,
1231 CreateOrResizeBuffer(device_data,
1241 VK_CHECK(device_data->vtable.MapMemory(device_data->device, draw->vertex_buffer_mem,
1243 VK_CHECK(device_data->vtable.MapMemory(device_data->device, draw->index_buffer_mem,
1260 VK_CHECK(device_data->vtable.FlushMappedMemoryRanges(device_data->device, 2, range));
1261 device_data->vtable.UnmapMemory(device_data->device, draw->vertex_buffer_mem);
1262 device_data->vtable.UnmapMemory(device_data->device, draw->index_buffer_mem);
1265 device_data->vtable.CmdBindPipeline(draw->command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, data->pipeline);
1267 device_data->vtable.CmdBindDescriptorSets(draw->command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
1273 device_data->vtable.CmdBindVertexBuffers(draw->command_buffer, 0, 1, vertex_buffers, vertex_offset);
1274 device_data->vtable.CmdBindIndexBuffer(draw->command_buffer, draw->index_buffer, 0, VK_INDEX_TYPE_UINT16);
1284 device_data->vtable.CmdSetViewport(draw->command_buffer, 0, 1, &viewport);
1299 device_data->vtable.CmdPushConstants(draw->command_buffer, data->pipeline_layout,
1302 device_data->vtable.CmdPushConstants(draw->command_buffer, data->pipeline_layout,
1323 device_data->vtable.CmdSetScissor(draw->command_buffer, 0, 1, &scissor);
1326 device_data->vtable.CmdDrawIndexed(draw->command_buffer, pcmd->ElemCount, 1, idx_offset, vtx_offset, 0);
1333 device_data->vtable.CmdEndRenderPass(draw->command_buffer);
1335 if (device_data->graphic_queue->family_index != present_queue->family_index)
1352 imb.srcQueueFamilyIndex = device_data->graphic_queue->family_index;
1354 device_data->vtable.CmdPipelineBarrier(draw->command_buffer,
1363 device_data->vtable.EndCommandBuffer(draw->command_buffer);
1370 if (n_wait_semaphores == 0 && device_data->graphic_queue->queue != present_queue->queue) {
1380 device_data->vtable.QueueSubmit(present_queue->queue, 1, &submit_info, VK_NULL_HANDLE);
1391 device_data->vtable.QueueSubmit(device_data->graphic_queue->queue, 1, &submit_info, draw->fence);
1410 device_data->vtable.QueueSubmit(device_data->graphic_queue->queue, 1, &submit_info, draw->fence);
1427 struct device_data *device_data = data->device;
1435 VK_CHECK(device_data->vtable.CreateShaderModule(device_data->device,
1441 VK_CHECK(device_data->vtable.CreateShaderModule(device_data->device,
1456 VK_CHECK(device_data->vtable.CreateSampler(device_data->device, &sampler_info,
1468 VK_CHECK(device_data->vtable.CreateDescriptorPool(device_data->device,
1483 VK_CHECK(device_data->vtable.CreateDescriptorSetLayout(device_data->device,
1493 VK_CHECK(device_data->vtable.AllocateDescriptorSets(device_data->device,
1510 VK_CHECK(device_data->vtable.CreatePipelineLayout(device_data->device,
1610 device_data->vtable.CreateGraphicsPipelines(device_data->device, VK_NULL_HANDLE,
1614 device_data->vtable.DestroyShaderModule(device_data->device, vert_module, NULL);
1615 device_data->vtable.DestroyShaderModule(device_data->device, frag_module, NULL);
1637 VK_CHECK(device_data->vtable.CreateImage(device_data->device, &image_info,
1640 device_data->vtable.GetImageMemoryRequirements(device_data->device,
1645 image_alloc_info.memoryTypeIndex = vk_memory_type(device_data,
1648 VK_CHECK(device_data->vtable.AllocateMemory(device_data->device, &image_alloc_info,
1650 VK_CHECK(device_data->vtable.BindImageMemory(device_data->device,
1663 VK_CHECK(device_data->vtable.CreateImageView(device_data->device, &view_info,
1677 device_data->vtable.UpdateDescriptorSets(device_data->device, 1, write_desc, 0, NULL);
1693 struct device_data *device_data = data->device;
1727 VK_CHECK(device_data->vtable.CreateRenderPass(device_data->device,
1733 VK_CHECK(device_data->vtable.GetSwapchainImagesKHR(device_data->device,
1742 VK_CHECK(device_data->vtable.GetSwapchainImagesKHR(device_data->device,
1759 VK_CHECK(device_data->vtable.CreateImageView(device_data->device,
1776 VK_CHECK(device_data->vtable.CreateFramebuffer(device_data->device, &fb_info,
1784 cmd_buffer_pool_info.queueFamilyIndex = device_data->graphic_queue->family_index;
1785 VK_CHECK(device_data->vtable.CreateCommandPool(device_data->device,
1792 struct device_data *device_data = data->device;
1795 device_data->vtable.DestroySemaphore(device_data->device, draw->cross_engine_semaphore, NULL);
1796 device_data->vtable.DestroySemaphore(device_data->device, draw->semaphore, NULL);
1797 device_data->vtable.DestroyFence(device_data->device, draw->fence, NULL);
1798 device_data->vtable.DestroyBuffer(device_data->device, draw->vertex_buffer, NULL);
1799 device_data->vtable.DestroyBuffer(device_data->device, draw->index_buffer, NULL);
1800 device_data->vtable.FreeMemory(device_data->device, draw->vertex_buffer_mem, NULL);
1801 device_data->vtable.FreeMemory(device_data->device, draw->index_buffer_mem, NULL);
1805 device_data->vtable.DestroyImageView(device_data->device, data->image_views[i], NULL);
1806 device_data->vtable.DestroyFramebuffer(device_data->device, data->framebuffers[i], NULL);
1809 device_data->vtable.DestroyRenderPass(device_data->device, data->render_pass, NULL);
1811 device_data->vtable.DestroyCommandPool(device_data->device, data->command_pool, NULL);
1813 device_data->vtable.DestroyPipeline(device_data->device, data->pipeline, NULL);
1814 device_data->vtable.DestroyPipelineLayout(device_data->device, data->pipeline_layout, NULL);
1816 device_data->vtable.DestroyDescriptorPool(device_data->device,
1818 device_data->vtable.DestroyDescriptorSetLayout(device_data->device,
1821 device_data->vtable.DestroySampler(device_data->device, data->font_sampler, NULL);
1822 device_data->vtable.DestroyImageView(device_data->device, data->font_image_view, NULL);
1823 device_data->vtable.DestroyImage(device_data->device, data->font_image, NULL);
1824 device_data->vtable.FreeMemory(device_data->device, data->font_mem, NULL);
1826 device_data->vtable.DestroyBuffer(device_data->device, data->upload_font_buffer, NULL);
1827 device_data->vtable.FreeMemory(device_data->device, data->upload_font_buffer_mem, NULL);
1859 struct device_data *device_data = FIND(struct device_data, device);
1860 VkResult result = device_data->vtable.CreateSwapchainKHR(device, pCreateInfo, pAllocator, pSwapchain);
1863 struct swapchain_data *swapchain_data = new_swapchain_data(*pSwapchain, device_data);
1874 struct device_data *device_data = FIND(struct device_data, device);
1875 device_data->vtable.DestroySwapchainKHR(device, swapchain, pAllocator);
1892 struct device_data *device_data = queue_data->device;
1893 struct instance_data *instance_data = device_data->instance;
1896 device_data->frame_stats.stats[OVERLAY_PARAM_ENABLED_frame]++;
1902 VK_CHECK(device_data->vtable.ResetFences(device_data->device,
1904 VK_CHECK(device_data->vtable.QueueSubmit(queue, 0, NULL, queue_data->queries_fence));
1905 VK_CHECK(device_data->vtable.WaitForFences(device_data->device,
1916 VK_CHECK(device_data->vtable.GetQueryPoolResults(device_data->device,
1924 device_data->frame_stats.stats[i] += query_results[i - OVERLAY_PARAM_ENABLED_vertices];
1929 VK_CHECK(device_data->vtable.GetQueryPoolResults(device_data->device,
1937 device_data->frame_stats.stats[OVERLAY_PARAM_ENABLED_gpu_timing] +=
1939 device_data->properties.limits.timestampPeriod;
2023 struct device_data *device_data = swapchain_data->device;
2026 VkResult result = device_data->vtable.AcquireNextImageKHR(device, swapchain, timeout,
2043 struct device_data *device_data = swapchain_data->device;
2046 VkResult result = device_data->vtable.AcquireNextImage2KHR(device, pAcquireInfo, pImageIndex);
2065 struct device_data *device_data = cmd_buffer_data->device;
2066 device_data->vtable.CmdDraw(commandBuffer, vertexCount, instanceCount,
2081 struct device_data *device_data = cmd_buffer_data->device;
2082 device_data->vtable.CmdDrawIndexed(commandBuffer, indexCount, instanceCount,
2096 struct device_data *device_data = cmd_buffer_data->device;
2097 device_data->vtable.CmdDrawIndirect(commandBuffer, buffer, offset, drawCount, stride);
2110 struct device_data *device_data = cmd_buffer_data->device;
2111 device_data->vtable.CmdDrawIndexedIndirect(commandBuffer, buffer, offset, drawCount, stride);
2126 struct device_data *device_data = cmd_buffer_data->device;
2127 device_data->vtable.CmdDrawIndirectCount(commandBuffer, buffer, offset,
2144 struct device_data *device_data = cmd_buffer_data->device;
2145 device_data->vtable.CmdDrawIndexedIndirectCount(commandBuffer, buffer, offset,
2159 struct device_data *device_data = cmd_buffer_data->device;
2160 device_data->vtable.CmdDispatch(commandBuffer, groupCountX, groupCountY, groupCountZ);
2171 struct device_data *device_data = cmd_buffer_data->device;
2172 device_data->vtable.CmdDispatchIndirect(commandBuffer, buffer, offset);
2188 struct device_data *device_data = cmd_buffer_data->device;
2189 device_data->vtable.CmdBindPipeline(commandBuffer, pipelineBindPoint, pipeline);
2198 struct device_data *device_data = cmd_buffer_data->device;
2228 VkResult result = device_data->vtable.BeginCommandBuffer(commandBuffer, pBeginInfo);
2239 VkResult result = device_data->vtable.BeginCommandBuffer(commandBuffer, pBeginInfo);
2243 device_data->vtable.CmdResetQueryPool(commandBuffer,
2248 device_data->vtable.CmdResetQueryPool(commandBuffer,
2253 device_data->vtable.CmdBeginQuery(commandBuffer,
2258 device_data->vtable.CmdWriteTimestamp(commandBuffer,
2273 struct device_data *device_data = cmd_buffer_data->device;
2276 device_data->vtable.CmdWriteTimestamp(commandBuffer,
2282 device_data->vtable.CmdEndQuery(commandBuffer,
2287 return device_data->vtable.EndCommandBuffer(commandBuffer);
2296 struct device_data *device_data = cmd_buffer_data->device;
2300 return device_data->vtable.ResetCommandBuffer(commandBuffer, flags);
2310 struct device_data *device_data = cmd_buffer_data->device;
2321 device_data->vtable.CmdExecuteCommands(commandBuffer, commandBufferCount, pCommandBuffers);
2329 struct device_data *device_data = FIND(struct device_data, device);
2331 device_data->vtable.AllocateCommandBuffers(device, pAllocateInfo, pCommandBuffers);
2337 if (device_data->instance->pipeline_statistics_enabled &&
2347 VK_CHECK(device_data->vtable.CreateQueryPool(device_data->device, &pool_info,
2350 if (device_data->instance->params.enabled[OVERLAY_PARAM_ENABLED_gpu_timing]) {
2359 VK_CHECK(device_data->vtable.CreateQueryPool(device_data->device, &pool_info,
2366 i, device_data);
2383 struct device_data *device_data = FIND(struct device_data, device);
2395 device_data->vtable.DestroyQueryPool(device_data->device,
2403 device_data->vtable.DestroyQueryPool(device_data->device,
2411 device_data->vtable.FreeCommandBuffers(device, commandPool,
2422 struct device_data *device_data = queue_data->device;
2424 device_data->frame_stats.stats[OVERLAY_PARAM_ENABLED_submit]++;
2433 device_data->frame_stats.stats[st] += cmd_buffer_data->stats.stats[st];
2452 return device_data->vtable.QueueSubmit(queue, submitCount, pSubmits, fence);
2462 struct device_data *device_data = queue_data->device;
2464 device_data->frame_stats.stats[OVERLAY_PARAM_ENABLED_submit]++;
2473 device_data->frame_stats.stats[st] += cmd_buffer_data->stats.stats[st];
2492 return device_data->vtable.QueueSubmit2KHR(queue, submitCount, pSubmits, fence);
2545 struct device_data *device_data = new_device_data(*pDevice, instance_data);
2546 device_data->physical_device = physicalDevice;
2547 vk_device_dispatch_table_load(&device_data->vtable,
2550 instance_data->pd_vtable.GetPhysicalDeviceProperties(device_data->physical_device,
2551 &device_data->properties);
2555 device_data->set_device_loader_data = load_data_info->u.pfnSetDeviceLoaderData;
2557 device_map_queues(device_data, pCreateInfo);
2566 struct device_data *device_data = FIND(struct device_data, device);
2567 device_unmap_queues(device_data);
2568 device_data->vtable.DestroyDevice(device, pAllocator);
2569 destroy_device_data(device_data);
2698 struct device_data *device_data = FIND(struct device_data, dev);
2699 if (device_data->vtable.GetDeviceProcAddr == NULL) return NULL;
2700 return device_data->vtable.GetDeviceProcAddr(dev, funcName);