Lines Matching refs:hwctx

274     AVVulkanDeviceContext *hwctx = dev_ctx->hwctx;
288 vk->GetPhysicalDeviceFormatProperties2(hwctx->phys_dev, fmt[i], &prop);
300 AVVulkanDeviceContext *hwctx = ctx->hwctx;
327 hwctx->get_proc_addr = (PFN_vkGetInstanceProcAddr)dlsym(p->libvulkan, "vkGetInstanceProcAddr");
430 AVVulkanDeviceContext *hwctx = ctx->hwctx;
470 vk->EnumerateDeviceExtensionProperties(hwctx->phys_dev, NULL,
475 vk->EnumerateDeviceExtensionProperties(hwctx->phys_dev, NULL,
668 AVVulkanDeviceContext *hwctx = ctx->hwctx;
682 if (!hwctx->get_proc_addr) {
702 hwctx->enabled_inst_extensions = inst_props.ppEnabledExtensionNames;
703 hwctx->nb_enabled_inst_extensions = inst_props.enabledExtensionCount;
708 ret = vk->CreateInstance(&inst_props, hwctx->alloc, &hwctx->inst);
738 vk->CreateDebugUtilsMessengerEXT(hwctx->inst, &dbg,
739 hwctx->alloc, &p->debug_ctx);
780 AVVulkanDeviceContext *hwctx = ctx->hwctx;
782 ret = vk->EnumeratePhysicalDevices(hwctx->inst, &num, NULL);
792 ret = vk->EnumeratePhysicalDevices(hwctx->inst, &num, devices);
888 hwctx->phys_dev = devices[choice];
929 AVVulkanDeviceContext *hwctx = ctx->hwctx;
933 vk->GetPhysicalDeviceQueueFamilyProperties(hwctx->phys_dev, &num, NULL);
945 vk->GetPhysicalDeviceQueueFamilyProperties(hwctx->phys_dev, &num, qf);
978 hwctx->queue_family_index = -1;
979 hwctx->queue_family_comp_index = -1;
980 hwctx->queue_family_tx_index = -1;
981 hwctx->queue_family_encode_index = -1;
982 hwctx->queue_family_decode_index = -1;
991 hwctx->queue_family_index = fidx; \
992 hwctx->nb_graphics_queues = qc; \
996 hwctx->queue_family_comp_index = fidx; \
997 hwctx->nb_comp_queues = qc; \
1001 hwctx->queue_family_tx_index = fidx; \
1002 hwctx->nb_tx_queues = qc; \
1006 hwctx->queue_family_encode_index = fidx; \
1007 hwctx->nb_encode_queues = qc; \
1011 hwctx->queue_family_decode_index = fidx; \
1012 hwctx->nb_decode_queues = qc; \
1060 AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx;
1078 ret = vk->CreateCommandPool(hwctx->act_dev, &cqueue_create,
1079 hwctx->alloc, &cmd->pool);
1093 ret = vk->AllocateCommandBuffers(hwctx->act_dev, &cbuf_create, cmd->bufs);
1107 vk->GetDeviceQueue(hwctx->act_dev, queue_family_index, i, &q->queue);
1116 AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx;
1126 vk->WaitForFences(hwctx->act_dev, 1, &q->fence, VK_TRUE, UINT64_MAX);
1127 vk->ResetFences(hwctx->act_dev, 1, &q->fence);
1132 vk->DestroyFence(hwctx->act_dev, q->fence, hwctx->alloc);
1142 vk->FreeCommandBuffers(hwctx->act_dev, cmd->pool, cmd->nb_queues, cmd->bufs);
1144 vk->DestroyCommandPool(hwctx->act_dev, cmd->pool, hwctx->alloc);
1168 AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx;
1183 ret = vk->CreateFence(hwctx->act_dev, &fence_spawn, hwctx->alloc,
1191 vk->WaitForFences(hwctx->act_dev, 1, &q->fence, VK_TRUE, UINT64_MAX);
1192 vk->ResetFences(hwctx->act_dev, 1, &q->fence);
1272 AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx;
1273 vk->WaitForFences(hwctx->act_dev, 1, &q->fence, VK_TRUE, UINT64_MAX);
1274 vk->ResetFences(hwctx->act_dev, 1, &q->fence);
1287 AVVulkanDeviceContext *hwctx = ctx->hwctx;
1289 if (hwctx->act_dev)
1290 vk->DestroyDevice(hwctx->act_dev, hwctx->alloc);
1293 vk->DestroyDebugUtilsMessengerEXT(hwctx->inst, p->debug_ctx,
1294 hwctx->alloc);
1296 if (hwctx->inst)
1297 vk->DestroyInstance(hwctx->inst, hwctx->alloc);
1302 RELEASE_PROPS(hwctx->enabled_inst_extensions, hwctx->nb_enabled_inst_extensions);
1303 RELEASE_PROPS(hwctx->enabled_dev_extensions, hwctx->nb_enabled_dev_extensions);
1315 AVVulkanDeviceContext *hwctx = ctx->hwctx;
1340 .pNext = &hwctx->device_features,
1343 hwctx->device_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
1344 hwctx->device_features.pNext = &p->device_features_1_1;
1358 vk->GetPhysicalDeviceFeatures2(hwctx->phys_dev, &dev_features);
1362 COPY_FEATURE(hwctx->device_features, shaderImageGatherExtended)
1363 COPY_FEATURE(hwctx->device_features, shaderStorageImageReadWithoutFormat)
1364 COPY_FEATURE(hwctx->device_features, shaderStorageImageWriteWithoutFormat)
1365 COPY_FEATURE(hwctx->device_features, fragmentStoresAndAtomics)
1366 COPY_FEATURE(hwctx->device_features, vertexPipelineStoresAndAtomics)
1367 COPY_FEATURE(hwctx->device_features, shaderInt64)
1390 ret = vk->CreateDevice(hwctx->phys_dev, &dev_info, hwctx->alloc,
1391 &hwctx->act_dev);
1418 hwctx->enabled_dev_extensions = dev_info.ppEnabledExtensionNames;
1419 hwctx->nb_enabled_dev_extensions = dev_info.enabledExtensionCount;
1429 AVVulkanDeviceContext *hwctx = ctx->hwctx;
1435 for (int i = 0; i < hwctx->nb_enabled_dev_extensions; i++) {
1437 if (!strcmp(hwctx->enabled_dev_extensions[i],
1455 vk->GetPhysicalDeviceProperties2(hwctx->phys_dev, &p->props);
1470 vk->GetPhysicalDeviceQueueFamilyProperties(hwctx->phys_dev, &queue_num, NULL);
1476 graph_index = hwctx->queue_family_index;
1477 comp_index = hwctx->queue_family_comp_index;
1478 tx_index = hwctx->queue_family_tx_index;
1479 enc_index = hwctx->queue_family_encode_index;
1480 dec_index = hwctx->queue_family_decode_index;
1512 CHECK_QUEUE("graphics", 0, graph_index, hwctx->queue_family_index, hwctx->nb_graphics_queues);
1513 CHECK_QUEUE("upload", 1, tx_index, hwctx->queue_family_tx_index, hwctx->nb_tx_queues);
1514 CHECK_QUEUE("compute", 1, comp_index, hwctx->queue_family_comp_index, hwctx->nb_comp_queues);
1515 CHECK_QUEUE("encode", 0, enc_index, hwctx->queue_family_encode_index, hwctx->nb_encode_queues);
1516 CHECK_QUEUE("decode", 0, dec_index, hwctx->queue_family_decode_index, hwctx->nb_decode_queues);
1521 vk->GetPhysicalDeviceMemoryProperties(hwctx->phys_dev, &p->mprops);
1555 AVVAAPIDeviceContext *src_hwctx = src_ctx->hwctx;
1572 AVDRMDeviceContext *src_hwctx = src_ctx->hwctx;
1592 AVCUDADeviceContext *src_hwctx = src_ctx->hwctx;
1667 AVVulkanDeviceContext *dev_hwctx = ctx->hwctx;
1729 AVCUDADeviceContext *cuda_dev = cuda_cu->hwctx;
1759 AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx;
1766 vk->DeviceWaitIdle(hwctx->act_dev);
1771 vk->DestroyImage(hwctx->act_dev, f->img[i], hwctx->alloc);
1772 vk->FreeMemory(hwctx->act_dev, f->mem[i], hwctx->alloc);
1773 vk->DestroySemaphore(hwctx->act_dev, f->sem[i], hwctx->alloc);
1787 AVVulkanFramesContext *hwfctx = hwfc->hwctx;
1795 AVVulkanDeviceContext *hwctx = ctx->hwctx;
1815 vk->GetImageMemoryRequirements2(hwctx->act_dev, &req_desc, &req);
1889 ret = vk->BindImageMemory2(hwctx->act_dev, planes, bind_info);
2026 AVVulkanDeviceContext *hwctx = ctx->hwctx;
2088 ret = vk->CreateImage(hwctx->act_dev, &create_info,
2089 hwctx->alloc, &f->img[i]);
2098 ret = vk->CreateSemaphore(hwctx->act_dev, &sem_spawn,
2099 hwctx->alloc, &f->sem[i]);
2101 av_log(hwctx, AV_LOG_ERROR, "Failed to create semaphore: %s\n",
2129 AVVulkanFramesContext *hwctx = hwfc->hwctx;
2130 AVVulkanDeviceContext *dev_hwctx = hwfc->device_ctx->hwctx;
2135 vk_find_struct(hwctx->create_pnext,
2137 int has_mods = hwctx->tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT && drm_mod_info;
2165 .tiling = hwctx->tiling,
2166 .usage = hwctx->usage,
2191 AVVulkanFramesContext *hwctx = hwfc->hwctx;
2199 .pNext = hwctx->create_pnext,
2219 eminfo[i].pNext = hwctx->alloc_pnext[i];
2223 err = create_frame(hwfc, &f, hwctx->tiling, hwctx->usage,
2267 AVVulkanFramesContext *hwctx = hwfc->hwctx;
2269 AVVulkanDeviceContext *dev_hwctx = hwfc->device_ctx->hwctx;
2275 hwctx->tiling = hwctx->tiling ? hwctx->tiling :
2280 if (!hwctx->usage)
2281 hwctx->usage = FF_VK_DEFAULT_USAGE_FLAGS;
2283 if (!(hwctx->flags & AV_VK_FRAME_FLAG_NONE)) {
2286 hwctx->flags |= AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY;
2289 modifier_info = vk_find_struct(hwctx->create_pnext,
2329 if (!hwctx->create_pnext)
2330 hwctx->create_pnext = modifier_info;
2332 vk_link_struct(hwctx->create_pnext, (void *)modifier_info);
2358 if (!(mod_props[i].drmFormatModifierTilingFeatures & hwctx->usage))
2393 err = create_frame(hwfc, &f, hwctx->tiling, hwctx->usage,
2394 hwctx->create_pnext);
2450 AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx;
2467 ret = vk->FlushMappedMemoryRanges(hwctx->act_dev, planes,
2476 vk->UnmapMemory(hwctx->act_dev, map->frame->mem[i]);
2487 AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx;
2488 AVVulkanFramesContext *hwfctx = hwfc->hwctx;
2517 ret = vk->MapMemory(hwctx->act_dev, f->mem[i], 0,
2543 ret = vk->InvalidateMappedMemoryRanges(hwctx->act_dev, planes,
2558 vk->GetImageSubresourceLayout(hwctx->act_dev, f->img[i], &sub, &layout);
2574 vk->UnmapMemory(hwctx->act_dev, f->mem[i]);
2584 AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx;
2597 vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX);
2602 vk->DestroyImage(hwctx->act_dev, f->img[i], hwctx->alloc);
2603 vk->FreeMemory(hwctx->act_dev, f->mem[i], hwctx->alloc);
2604 vk->DestroySemaphore(hwctx->act_dev, f->sem[i], hwctx->alloc);
2642 AVVulkanDeviceContext *hwctx = ctx->hwctx;
2744 ret = vk->GetPhysicalDeviceImageFormatProperties2(hwctx->phys_dev,
2767 ret = vk->CreateImage(hwctx->act_dev, &create_info,
2768 hwctx->alloc, &f->img[i]);
2776 ret = vk->CreateSemaphore(hwctx->act_dev, &sem_spawn,
2777 hwctx->alloc, &f->sem[i]);
2779 av_log(hwctx, AV_LOG_ERROR, "Failed to create semaphore: %s\n",
2824 ret = vk->GetMemoryFdPropertiesKHR(hwctx->act_dev,
2835 vk->GetImageMemoryRequirements2(hwctx->act_dev, &req_desc, &req2);
2878 ret = vk->BindImageMemory2(hwctx->act_dev, bind_counts, bind_info);
2896 vk->DestroyImage(hwctx->act_dev, f->img[i], hwctx->alloc);
2897 vk->DestroySemaphore(hwctx->act_dev, f->sem[i], hwctx->alloc);
2900 vk->FreeMemory(hwctx->act_dev, f->mem[i], hwctx->alloc);
2931 vulkan_frame_free(hwfc->device_ctx->hwctx, (uint8_t *)f);
2944 AVVAAPIDeviceContext *vaapi_ctx = vaapi_fc->device_ctx->hwctx;
2982 AVVulkanDeviceContext *hwctx = ctx->hwctx;
2990 AVCUDADeviceContext *cuda_dev = cuda_cu->hwctx;
3050 ret = vk->GetMemoryWin32HandleKHR(hwctx->act_dev, &export_info,
3078 ret = vk->GetMemoryFdKHR(hwctx->act_dev, &export_info,
3117 ret = vk->GetSemaphoreWin32HandleKHR(hwctx->act_dev, &sem_export,
3120 ret = vk->GetSemaphoreFdKHR(hwctx->act_dev, &sem_export,
3165 AVCUDADeviceContext *cuda_dev = cuda_cu->hwctx;
3302 AVVulkanDeviceContext *hwctx = hwfc->device_ctx->hwctx;
3303 AVVulkanFramesContext *hwfctx = hwfc->hwctx;
3326 vk->WaitSemaphores(hwctx->act_dev, &wait_info, UINT64_MAX);
3332 ret = vk->GetImageDrmFormatModifierPropertiesEXT(hwctx->act_dev, f->img[0],
3347 ret = vk->GetMemoryFdKHR(hwctx->act_dev, &export_info,
3382 vk->GetImageSubresourceLayout(hwctx->act_dev, f->img[i], &sub, &layout);
3466 AVVulkanDeviceContext *hwctx = ctx->hwctx;
3472 vk->DestroyBuffer(hwctx->act_dev, vkbuf->buf, hwctx->alloc);
3474 vk->FreeMemory(hwctx->act_dev, vkbuf->mem, hwctx->alloc);
3496 AVVulkanDeviceContext *hwctx = ctx->hwctx;
3529 ret = vk->CreateBuffer(hwctx->act_dev, &buf_spawn, NULL, &vkbuf->buf);
3539 vk->GetBufferMemoryRequirements2(hwctx->act_dev, &req_desc, &req);
3557 ret = vk->BindBufferMemory(hwctx->act_dev, vkbuf->buf, vkbuf->mem, 0);
3583 AVVulkanDeviceContext *hwctx = ctx->hwctx;
3594 ret = vk->MapMemory(hwctx->act_dev, vkbuf->mem, 0,
3627 ret = vk->InvalidateMappedMemoryRanges(hwctx->act_dev, invalidate_count,
3642 AVVulkanDeviceContext *hwctx = ctx->hwctx;
3665 ret = vk->FlushMappedMemoryRanges(hwctx->act_dev, flush_count, flush_ctx);
3678 vk->UnmapMemory(hwctx->act_dev, vkbuf->mem);
3821 AVVulkanDeviceContext *hwctx = dev_ctx->hwctx;
3893 ret = vk->GetMemoryHostPointerPropertiesEXT(hwctx->act_dev,
4010 AVCUDADeviceContext *cuda_dev = cuda_cu->hwctx;