mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-07-10 19:29:46 +00:00
Fixed Vulkan validation errors when using ffmpeg video decode
This commit is contained in:
@@ -896,11 +896,16 @@ static VkResult VULKAN_AllocateImage(VULKAN_RenderData *rendererData, SDL_Proper
|
||||
imageViewCreateInfo.subresourceRange.baseArrayLayer = 0;
|
||||
imageViewCreateInfo.subresourceRange.layerCount = 1;
|
||||
|
||||
VkImageViewUsageCreateInfo imageViewUsageCreateInfo = { 0 };
|
||||
imageViewUsageCreateInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_USAGE_CREATE_INFO;
|
||||
imageViewUsageCreateInfo.usage = imageUsage;
|
||||
imageViewCreateInfo.pNext = &imageViewUsageCreateInfo;
|
||||
|
||||
// If it's a YCbCr image, we need to pass the conversion info to the VkImageView (and the VkSampler)
|
||||
if (samplerYcbcrConversion != VK_NULL_HANDLE) {
|
||||
samplerYcbcrConversionInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR;
|
||||
samplerYcbcrConversionInfo.conversion = samplerYcbcrConversion;
|
||||
imageViewCreateInfo.pNext = &samplerYcbcrConversionInfo;
|
||||
imageViewUsageCreateInfo.pNext = &samplerYcbcrConversionInfo;
|
||||
}
|
||||
|
||||
result = vkCreateImageView(rendererData->device, &imageViewCreateInfo, NULL, &imageOut->imageView);
|
||||
@@ -2745,8 +2750,8 @@ static bool VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, S
|
||||
// Also create VkSampler object which we will need to pass to the PSO as an immutable sampler
|
||||
VkSamplerCreateInfo samplerCreateInfo = { 0 };
|
||||
samplerCreateInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
|
||||
samplerCreateInfo.magFilter = VK_FILTER_NEAREST;
|
||||
samplerCreateInfo.minFilter = VK_FILTER_NEAREST;
|
||||
samplerCreateInfo.magFilter = VK_FILTER_LINEAR;
|
||||
samplerCreateInfo.minFilter = VK_FILTER_LINEAR;
|
||||
samplerCreateInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST;
|
||||
samplerCreateInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
|
||||
samplerCreateInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
|
||||
|
||||
Reference in New Issue
Block a user