vulkan: enable samplerYcbcrConversion when creating the device
parent
ffef13e1e1
commit
759ade8c90
|
@ -1782,10 +1782,11 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert
|
|||
if (rendererData->device) {
|
||||
rendererData->device_external = SDL_TRUE;
|
||||
} else {
|
||||
VkPhysicalDeviceSamplerYcbcrConversionFeatures deviceSamplerYcbcrConversionFeatures = { 0 };
|
||||
VkDeviceQueueCreateInfo deviceQueueCreateInfo[2] = { { 0 }, { 0 } };
|
||||
static const float queuePriority[] = { 1.0f };
|
||||
VkDeviceCreateInfo deviceCreateInfo = { 0 };
|
||||
|
||||
VkDeviceCreateInfo deviceCreateInfo = { 0 };
|
||||
deviceCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
|
||||
deviceCreateInfo.queueCreateInfoCount = 0;
|
||||
deviceCreateInfo.pQueueCreateInfos = deviceQueueCreateInfo;
|
||||
|
@ -1807,6 +1808,13 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert
|
|||
++deviceCreateInfo.queueCreateInfoCount;
|
||||
}
|
||||
|
||||
if (rendererData->supportsKHRSamplerYCbCrConversion) {
|
||||
deviceSamplerYcbcrConversionFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_YCBCR_CONVERSION_FEATURES;
|
||||
deviceSamplerYcbcrConversionFeatures.samplerYcbcrConversion = VK_TRUE;
|
||||
deviceSamplerYcbcrConversionFeatures.pNext = (void *)deviceCreateInfo.pNext;
|
||||
deviceCreateInfo.pNext = &deviceSamplerYcbcrConversionFeatures;
|
||||
}
|
||||
|
||||
result = vkCreateDevice(rendererData->physicalDevice, &deviceCreateInfo, NULL, &rendererData->device);
|
||||
if (result != VK_SUCCESS) {
|
||||
SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreateDevice(): %s\n", SDL_Vulkan_GetResultString(result));
|
||||
|
|
Loading…
Reference in New Issue