From ad036d43e97c5cce1d196c0f85b0fc10c69fa70d Mon Sep 17 00:00:00 2001 From: Dan Ginsburg Date: Wed, 28 Feb 2024 11:57:09 -0500 Subject: [PATCH] Vulkan Renderer - implement YcBcCr using VK_KHR_sampler_ycbcr_conversion. (#9169) * Vulkan Renderer - implement YcBcCr using VK_KHR_sampler_ycbcr_conversion. This simplifies the shader code and will also allow support for additional formats that we don't yet support (such as SDL_PIXELFORMAT_P010 for ffmpeg). The renderer now queries for VK_KHR_sampler_ycbcr_conversion and dependent extensions and will enable it if it's present. It reimplements YUV/NV12 texture support using this extension (these formats are no longer supported if the extension is not present). For each YUV/NV12 texture, a VkSamplerYcbcrConversion object is created from SDL_Colorspace parameters. This is passed to the VkImageView and also an additional sampler is created for Ycbcr. Instead of using 1-3 textures, the shaders now all use 1 texture with a combined image sampler (required by the extension). Further, when using Ycbcr, a separate descriptor set layout is baked with the Ycbcr sampler as an immutable sampler. The code to copy the images now copies to the individual image planes. The swizzling between formats is handled in the VkSamplerYcbcrConversion object. --- src/render/vulkan/SDL_render_vulkan.c | 750 ++++++++++-------- .../vulkan/VULKAN_PixelShader_Advanced.h | 554 ++++++------- src/render/vulkan/VULKAN_PixelShader_Colors.h | 80 +- .../vulkan/VULKAN_PixelShader_Common.incl | 59 +- .../vulkan/VULKAN_PixelShader_Textures.h | 102 ++- src/render/vulkan/compile_shaders.bat | 6 +- 6 files changed, 726 insertions(+), 825 deletions(-) diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index 61524341e..14c9a9103 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -129,15 +129,26 @@ extern const char *SDL_Vulkan_GetResultString(VkResult result); VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceSurfaceFormatsKHR) \ VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceSurfacePresentModesKHR) \ VULKAN_INSTANCE_FUNCTION(vkGetPhysicalDeviceSurfaceSupportKHR) \ - VULKAN_INSTANCE_FUNCTION(vkQueueWaitIdle) + VULKAN_INSTANCE_FUNCTION(vkQueueWaitIdle) \ + VULKAN_OPTIONAL_INSTANCE_FUNCTION(vkGetPhysicalDeviceFeatures2KHR) \ + VULKAN_OPTIONAL_INSTANCE_FUNCTION(vkGetPhysicalDeviceFormatProperties2KHR) \ + VULKAN_OPTIONAL_INSTANCE_FUNCTION(vkGetPhysicalDeviceImageFormatProperties2KHR) \ + VULKAN_OPTIONAL_INSTANCE_FUNCTION(vkGetPhysicalDeviceMemoryProperties2KHR) \ + VULKAN_OPTIONAL_INSTANCE_FUNCTION(vkGetPhysicalDeviceProperties2KHR) \ + VULKAN_OPTIONAL_DEVICE_FUNCTION(vkCreateSamplerYcbcrConversionKHR) \ + VULKAN_OPTIONAL_DEVICE_FUNCTION(vkDestroySamplerYcbcrConversionKHR) \ -#define VULKAN_DEVICE_FUNCTION(name) static PFN_##name name = NULL; -#define VULKAN_GLOBAL_FUNCTION(name) static PFN_##name name = NULL; -#define VULKAN_INSTANCE_FUNCTION(name) static PFN_##name name = NULL; +#define VULKAN_DEVICE_FUNCTION(name) static PFN_##name name = NULL; +#define VULKAN_GLOBAL_FUNCTION(name) static PFN_##name name = NULL; +#define VULKAN_INSTANCE_FUNCTION(name) static PFN_##name name = NULL; +#define VULKAN_OPTIONAL_INSTANCE_FUNCTION(name) static PFN_##name name = NULL; +#define VULKAN_OPTIONAL_DEVICE_FUNCTION(name) static PFN_##name name = NULL; VULKAN_FUNCTIONS() #undef VULKAN_DEVICE_FUNCTION #undef VULKAN_GLOBAL_FUNCTION #undef VULKAN_INSTANCE_FUNCTION +#undef VULKAN_OPTIONAL_INSTANCE_FUNCTION +#undef VULKAN_OPTIONAL_DEVICE_FUNCTION /* Renderpass types */ typedef enum { @@ -165,12 +176,6 @@ typedef struct //static const float TONEMAP_LINEAR = 1; static const float TONEMAP_CHROME = 2; -//static const float TEXTURETYPE_NONE = 0; -static const float TEXTURETYPE_RGB = 1; -static const float TEXTURETYPE_NV12 = 2; -static const float TEXTURETYPE_NV21 = 3; -static const float TEXTURETYPE_YUV = 4; - static const float INPUTTYPE_UNSPECIFIED = 0; static const float INPUTTYPE_SRGB = 1; static const float INPUTTYPE_SCRGB = 2; @@ -180,9 +185,9 @@ static const float INPUTTYPE_HDR10 = 3; typedef struct { float scRGB_output; - float texture_type; float input_type; float color_scale; + float unused_pad0; float tonemap_method; float tonemap_factor1; @@ -236,14 +241,14 @@ typedef struct const float *YCbCr_matrix; #if SDL_HAVE_YUV - /* YV12 texture support */ - SDL_bool yuv; - VULKAN_Image mainImageU; - VULKAN_Image mainImageV; - - /* NV12 texture support */ - SDL_bool nv12; - VULKAN_Image mainImageUV; + /* Object passed to VkImageView and VkSampler for doing Ycbcr -> RGB conversion */ + VkSamplerYcbcrConversion samplerYcbcrConversion; + /* Sampler created with samplerYcbcrConversion, passed to PSO as immutable sampler */ + VkSampler samplerYcbcr; + /* Descriptor set layout with samplerYcbcr baked as immutable sampler */ + VkDescriptorSetLayout descriptorSetLayoutYcbcr; + /* Pipeline layout with immutable sampler descriptor set layout */ + VkPipelineLayout pipelineLayoutYcbcr; #endif } VULKAN_TextureData; @@ -257,6 +262,7 @@ typedef struct VkPrimitiveTopology topology; VkFormat format; VkPipelineLayout pipelineLayout; + VkDescriptorSetLayout descriptorSetLayout; VkPipeline pipeline; } VULKAN_PipelineState; @@ -299,8 +305,8 @@ typedef struct VkShaderModule vertexShaderModules[NUM_SHADERS]; VkShaderModule fragmentShaderModules[NUM_SHADERS]; - VkDescriptorSetLayout descriptorSetLayouts[NUM_SHADERS]; - VkPipelineLayout pipelineLayouts[NUM_SHADERS]; + VkDescriptorSetLayout descriptorSetLayout; + VkPipelineLayout pipelineLayout; /* Vertex buffer data */ VULKAN_Buffer vertexBuffers[SDL_VULKAN_NUM_VERTEX_BUFFERS]; @@ -327,6 +333,8 @@ typedef struct VULKAN_PipelineState *currentPipelineState; SDL_bool supportsEXTSwapchainColorspace; + SDL_bool supportsKHRGetPhysicalDeviceProperties2; + SDL_bool supportsKHRSamplerYcBcrConversion; uint32_t surfaceFormatsAllocatedCount; uint32_t surfaceFormatsCount; uint32_t swapchainDesiredImageCount; @@ -357,7 +365,6 @@ typedef struct Uint32 VULKAN_VkFormatToSDLPixelFormat(VkFormat vkFormat) { switch (vkFormat) { - case VK_FORMAT_B8G8R8A8_UNORM: return SDL_PIXELFORMAT_ARGB8888; case VK_FORMAT_A2R10G10B10_UNORM_PACK32: @@ -369,6 +376,18 @@ Uint32 VULKAN_VkFormatToSDLPixelFormat(VkFormat vkFormat) } } +Uint32 VULKAN_VkFormatGetNumPlanes(VkFormat vkFormat) +{ + switch (vkFormat) { + case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM: + return 3; + case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM: + return 2; + default: + return 1; + } +} + VkDeviceSize VULKAN_GetBytesPerPixel(VkFormat vkFormat) { switch (vkFormat) { @@ -402,17 +421,23 @@ static VkFormat SDLPixelFormatToVkTextureFormat(Uint32 format, Uint32 colorspace return VK_FORMAT_B8G8R8A8_SRGB; } return VK_FORMAT_B8G8R8A8_UNORM; + case SDL_PIXELFORMAT_YUY2: + return VK_FORMAT_G8B8G8R8_422_UNORM; + case SDL_PIXELFORMAT_UYVY: + return VK_FORMAT_B8G8R8G8_422_UNORM; case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_IYUV: - case SDL_PIXELFORMAT_NV12: /* Y plane */ - case SDL_PIXELFORMAT_NV21: /* Y plane */ - return VK_FORMAT_R8_UNORM; + return VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM; + case SDL_PIXELFORMAT_NV12: + case SDL_PIXELFORMAT_NV21: + return VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; case SDL_PIXELFORMAT_P010: - return VK_FORMAT_R16_UNORM; + return VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16; default: return VK_FORMAT_UNDEFINED; } } + static void VULKAN_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture); static void VULKAN_DestroyBuffer(VULKAN_RenderData *rendererData, VULKAN_Buffer *vulkanBuffer); static void VULKAN_DestroyImage(VULKAN_RenderData *rendererData, VULKAN_Image *vulkanImage); @@ -420,6 +445,7 @@ static void VULKAN_ResetCommandList(VULKAN_RenderData *rendererData); static SDL_bool VULKAN_FindMemoryTypeIndex(VULKAN_RenderData *rendererData, uint32_t typeBits, VkMemoryPropertyFlags requiredFlags, VkMemoryPropertyFlags desiredFlags, uint32_t *memoryTypeIndexOut); static VkResult VULKAN_CreateWindowSizeDependentResources(SDL_Renderer *renderer); static VkDescriptorPool VULKAN_AllocateDescriptorPool(VULKAN_RenderData *rendererData); +static VkResult VULKAN_CreateDescriptorSetAndPipelineLayout(VULKAN_RenderData *rendererData, VkSampler samplerYcbcr, VkDescriptorSetLayout *descriptorSetLayoutOut, VkPipelineLayout *pipelineLayoutOut); static void VULKAN_DestroyAll(SDL_Renderer *renderer) { @@ -531,14 +557,14 @@ static void VULKAN_DestroyAll(SDL_Renderer *renderer) vkDestroyShaderModule(rendererData->device, rendererData->fragmentShaderModules[i], NULL); rendererData->fragmentShaderModules[i] = VK_NULL_HANDLE; } - if (rendererData->descriptorSetLayouts[i] != VK_NULL_HANDLE) { - vkDestroyDescriptorSetLayout(rendererData->device, rendererData->descriptorSetLayouts[i], NULL); - rendererData->descriptorSetLayouts[i] = VK_NULL_HANDLE; - } - if (rendererData->pipelineLayouts[i] != VK_NULL_HANDLE) { - vkDestroyPipelineLayout(rendererData->device, rendererData->pipelineLayouts[i], NULL); - rendererData->pipelineLayouts[i] = VK_NULL_HANDLE; - } + } + if (rendererData->descriptorSetLayout != VK_NULL_HANDLE) { + vkDestroyDescriptorSetLayout(rendererData->device, rendererData->descriptorSetLayout, NULL); + rendererData->descriptorSetLayout = VK_NULL_HANDLE; + } + if (rendererData->pipelineLayout != VK_NULL_HANDLE) { + vkDestroyPipelineLayout(rendererData->device, rendererData->pipelineLayout, NULL); + rendererData->pipelineLayout = VK_NULL_HANDLE; } for (int i = 0; i < rendererData->pipelineStateCount; i++) { vkDestroyPipeline(rendererData->device, rendererData->pipelineStates[i].pipeline, NULL); @@ -672,12 +698,16 @@ static void VULKAN_DestroyImage(VULKAN_RenderData *rendererData, VULKAN_Image *v SDL_memset(vulkanImage, 0, sizeof(VULKAN_Image)); } -static VkResult VULKAN_AllocateImage(VULKAN_RenderData *rendererData, uint32_t width, uint32_t height, VkFormat format, VkImageUsageFlags imageUsage, VkComponentMapping swizzle, VkImage externalImage, VULKAN_Image *imageOut) +static VkResult VULKAN_AllocateImage(VULKAN_RenderData *rendererData, uint32_t width, uint32_t height, VkFormat format, + VkImageUsageFlags imageUsage, VkComponentMapping swizzle, VkImage externalImage, + VkSamplerYcbcrConversionKHR samplerYcbcrConversion, + VULKAN_Image *imageOut) { VkResult result; VkImageCreateInfo imageCreateInfo = { 0 }; + VkSamplerYcbcrConversionInfoKHR samplerYcbcrConversionInfo = { 0 }; - SDL_memset(imageOut, 0, sizeof( VULKAN_Image)); + SDL_memset(imageOut, 0, sizeof(VULKAN_Image)); imageOut->format = format; imageOut->imageLayout = VK_IMAGE_LAYOUT_UNDEFINED; @@ -751,6 +781,14 @@ static VkResult VULKAN_AllocateImage(VULKAN_RenderData *rendererData, uint32_t w imageViewCreateInfo.subresourceRange.levelCount = 1; imageViewCreateInfo.subresourceRange.baseArrayLayer = 0; imageViewCreateInfo.subresourceRange.layerCount = 1; + + /* If it's a YcBcBr 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; + } + result = vkCreateImageView(rendererData->device, &imageViewCreateInfo, NULL, &imageOut->imageView); if (result != VK_SUCCESS) { VULKAN_DestroyImage(rendererData, imageOut); @@ -1034,7 +1072,7 @@ static VkBlendOp GetBlendOp(SDL_BlendOperation operation) static VULKAN_PipelineState *VULKAN_CreatePipelineState(SDL_Renderer *renderer, - VULKAN_Shader shader, SDL_BlendMode blendMode, VkPrimitiveTopology topology, VkFormat format) + VULKAN_Shader shader, VkPipelineLayout pipelineLayout, VkDescriptorSetLayout descriptorSetLayout, SDL_BlendMode blendMode, VkPrimitiveTopology topology, VkFormat format) { VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; VULKAN_PipelineState *pipelineStates; @@ -1159,7 +1197,7 @@ static VULKAN_PipelineState *VULKAN_CreatePipelineState(SDL_Renderer *renderer, /* Renderpass / layout */ pipelineCreateInfo.renderPass = rendererData->currentRenderPass; pipelineCreateInfo.subpass = 0; - pipelineCreateInfo.layout = rendererData->pipelineLayouts[shader]; + pipelineCreateInfo.layout = pipelineLayout; result = vkCreateGraphicsPipelines(rendererData->device, VK_NULL_HANDLE, 1, &pipelineCreateInfo, NULL, &pipeline); if (result != VK_SUCCESS) { @@ -1173,6 +1211,7 @@ static VULKAN_PipelineState *VULKAN_CreatePipelineState(SDL_Renderer *renderer, pipelineStates[rendererData->pipelineStateCount].topology = topology; pipelineStates[rendererData->pipelineStateCount].format = format; pipelineStates[rendererData->pipelineStateCount].pipeline = pipeline; + pipelineStates[rendererData->pipelineStateCount].descriptorSetLayout = descriptorSetLayout; pipelineStates[rendererData->pipelineStateCount].pipelineLayout = pipelineCreateInfo.layout; rendererData->pipelineStates = pipelineStates; ++rendererData->pipelineStateCount; @@ -1244,10 +1283,14 @@ static int VULKAN_LoadGlobalFunctions(VULKAN_RenderData *rendererData) return -1; \ } #define VULKAN_INSTANCE_FUNCTION(name) +#define VULKAN_OPTIONAL_INSTANCE_FUNCTION(name) +#define VULKAN_OPTIONAL_DEVICE_FUNCTION(name) VULKAN_FUNCTIONS() #undef VULKAN_DEVICE_FUNCTION #undef VULKAN_GLOBAL_FUNCTION #undef VULKAN_INSTANCE_FUNCTION +#undef VULKAN_OPTIONAL_INSTANCE_FUNCTION +#undef VULKAN_OPTIONAL_DEVICE_FUNCTION return 0; } @@ -1263,10 +1306,16 @@ static int VULKAN_LoadInstanceFunctions(VULKAN_RenderData *rendererData) "vkGetInstanceProcAddr(instance, \"" #name "\") failed\n"); \ return -1; \ } +#define VULKAN_OPTIONAL_INSTANCE_FUNCTION(name) \ + name = (PFN_##name)rendererData->vkGetInstanceProcAddr(rendererData->instance, #name); +#define VULKAN_OPTIONAL_DEVICE_FUNCTION(name) + VULKAN_FUNCTIONS() #undef VULKAN_DEVICE_FUNCTION #undef VULKAN_GLOBAL_FUNCTION #undef VULKAN_INSTANCE_FUNCTION +#undef VULKAN_OPTIONAL_INSTANCE_FUNCTION +#undef VULKAN_OPTIONAL_DEVICE_FUNCTION return 0; } @@ -1281,11 +1330,16 @@ static int VULKAN_LoadDeviceFunctions(VULKAN_RenderData *rendererData) return -1; \ } #define VULKAN_GLOBAL_FUNCTION(name) +#define VULKAN_OPTIONAL_DEVICE_FUNCTION(name) \ + name = (PFN_##name)vkGetDeviceProcAddr(rendererData->device, #name); #define VULKAN_INSTANCE_FUNCTION(name) +#define VULKAN_OPTIONAL_INSTANCE_FUNCTION(name) VULKAN_FUNCTIONS() #undef VULKAN_DEVICE_FUNCTION #undef VULKAN_GLOBAL_FUNCTION #undef VULKAN_INSTANCE_FUNCTION +#undef VULKAN_OPTIONAL_INSTANCE_FUNCTION +#undef VULKAN_OPTIONAL_DEVICE_FUNCTION return 0; } @@ -1476,6 +1530,40 @@ static VkSemaphore VULKAN_CreateSemaphore(VULKAN_RenderData *rendererData) return semaphore; } +static SDL_bool VULKAN_DeviceExtensionsFound(VULKAN_RenderData *rendererData, int extensionsToCheck, const char* const* extNames) +{ + uint32_t extensionCount; + SDL_bool foundExtensions = SDL_TRUE; + VkResult result = vkEnumerateDeviceExtensionProperties(rendererData->physicalDevice, NULL, &extensionCount, NULL); + if (result != VK_SUCCESS ) { + SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkEnumerateDeviceExtensionProperties(): %s.\n", SDL_Vulkan_GetResultString(result)); + return SDL_FALSE; + } + if (extensionCount > 0 ) { + VkExtensionProperties *extensionProperties = SDL_calloc(sizeof(VkExtensionProperties), extensionCount); + result = vkEnumerateDeviceExtensionProperties(rendererData->physicalDevice, NULL, &extensionCount, extensionProperties); + if (result != VK_SUCCESS ) { + SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkEnumerateDeviceExtensionProperties): %s.\n", SDL_Vulkan_GetResultString(result)); + SDL_free(extensionProperties); + return SDL_FALSE; + } + for (uint32_t ext = 0; ext < extensionsToCheck && foundExtensions; ext++) { + SDL_bool foundExtension = SDL_FALSE; + for (uint32_t i = 0; i< extensionCount; i++) { + if (SDL_strcmp(extensionProperties[i].extensionName, extNames[ext]) == 0) { + foundExtension = SDL_TRUE; + break; + } + } + foundExtensions &= foundExtension; + } + + SDL_free(extensionProperties); + } + + return foundExtensions; +} + static SDL_bool VULKAN_InstanceExtensionFound(VULKAN_RenderData *rendererData, const char *extName) { uint32_t extensionCount; @@ -1553,6 +1641,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert } /* Check for colorspace extension */ + rendererData->supportsEXTSwapchainColorspace = VK_FALSE; if (renderer->output_colorspace == SDL_COLORSPACE_SRGB_LINEAR || renderer->output_colorspace == SDL_COLORSPACE_HDR10) { rendererData->supportsEXTSwapchainColorspace = VULKAN_InstanceExtensionFound(rendererData, VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME); @@ -1561,6 +1650,9 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert } } + /* Check for VK_KHR_get_physical_device_properties2 */ + rendererData->supportsKHRGetPhysicalDeviceProperties2 = VULKAN_InstanceExtensionFound(rendererData, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); + /* Create VkInstance */ rendererData->instance = (VkInstance)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, NULL); if (rendererData->instance) { @@ -1574,7 +1666,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert instanceCreateInfo.pApplicationInfo = &appInfo; char const *const *instanceExtensions = SDL_Vulkan_GetInstanceExtensions(&instanceCreateInfo.enabledExtensionCount); - const char **instanceExtensionsCopy = SDL_calloc(instanceCreateInfo.enabledExtensionCount + 1, sizeof(const char *)); + const char **instanceExtensionsCopy = SDL_calloc(instanceCreateInfo.enabledExtensionCount + 2, sizeof(const char *)); for (uint32_t i = 0; i < instanceCreateInfo.enabledExtensionCount; i++) { instanceExtensionsCopy[i] = instanceExtensions[i]; } @@ -1582,6 +1674,10 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert instanceExtensionsCopy[instanceCreateInfo.enabledExtensionCount] = VK_EXT_SWAPCHAIN_COLOR_SPACE_EXTENSION_NAME; instanceCreateInfo.enabledExtensionCount++; } + if (rendererData->supportsKHRGetPhysicalDeviceProperties2) { + instanceExtensionsCopy[instanceCreateInfo.enabledExtensionCount] = VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME; + instanceCreateInfo.enabledExtensionCount++; + } instanceCreateInfo.ppEnabledExtensionNames = (const char *const *)instanceExtensionsCopy; if (createDebug && VULKAN_ValidationLayersFound()) { instanceCreateInfo.ppEnabledLayerNames = validationLayerName; @@ -1632,6 +1728,8 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert rendererData->presentQueueFamilyIndex = (uint32_t)SDL_GetNumberProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER, 0); } + + /* Create Vulkan device */ rendererData->device = (VkDevice)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, NULL); if (rendererData->device) { @@ -1642,13 +1740,24 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert VkDeviceCreateInfo deviceCreateInfo = { 0 }; static const char *const deviceExtensionNames[] = { VK_KHR_SWAPCHAIN_EXTENSION_NAME, + /* VK_KHR_sampler_ycbcr_conversion + dependent extensions. + Note VULKAN_DeviceExtensionsFound() call below, if these get moved in this + array, update that check too. + */ + VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME, + VK_KHR_MAINTENANCE1_EXTENSION_NAME, + VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, + VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, }; - + if (rendererData->supportsKHRGetPhysicalDeviceProperties2 && + VULKAN_DeviceExtensionsFound(rendererData, 4, &deviceExtensionNames[1])) { + rendererData->supportsKHRSamplerYcBcrConversion = SDL_TRUE; + } deviceCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO; deviceCreateInfo.queueCreateInfoCount = 0; deviceCreateInfo.pQueueCreateInfos = deviceQueueCreateInfo; deviceCreateInfo.pEnabledFeatures = NULL; - deviceCreateInfo.enabledExtensionCount = SDL_arraysize(deviceExtensionNames); + deviceCreateInfo.enabledExtensionCount = (rendererData->supportsKHRSamplerYcBcrConversion) ? 5 : 1; deviceCreateInfo.ppEnabledExtensionNames = deviceExtensionNames; deviceQueueCreateInfo[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; @@ -1721,73 +1830,14 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreateShaderModule(): %s\n", SDL_Vulkan_GetResultString(result)); return result; } + } - /* Descriptor set layout */ - VkDescriptorSetLayoutCreateInfo descriptorSetLayoutCreateInfo = { 0 }; - descriptorSetLayoutCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; - descriptorSetLayoutCreateInfo.flags = 0; - VkDescriptorSetLayoutBinding layoutBindings[5]; - /* PixelShaderConstants */ - layoutBindings[0].binding = 4; - layoutBindings[0].descriptorCount = 1; - layoutBindings[0].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; - layoutBindings[0].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; - layoutBindings[0].pImmutableSamplers = NULL; - - /* sampler0 */ - layoutBindings[1].binding = 0; - layoutBindings[1].descriptorCount = 1; - layoutBindings[1].descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER; - layoutBindings[1].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; - layoutBindings[1].pImmutableSamplers = NULL; - - /* texture0 */ - layoutBindings[2].binding = 1; - layoutBindings[2].descriptorCount = 1; - layoutBindings[2].descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; - layoutBindings[2].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; - layoutBindings[2].pImmutableSamplers = NULL; - - /* texture1 */ - layoutBindings[3].binding = 2; - layoutBindings[3].descriptorCount = 1; - layoutBindings[3].descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; - layoutBindings[3].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; - layoutBindings[3].pImmutableSamplers = NULL; - - /* texture2 */ - layoutBindings[4].binding = 3; - layoutBindings[4].descriptorCount = 1; - layoutBindings[4].descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; - layoutBindings[4].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; - layoutBindings[4].pImmutableSamplers = NULL; - - descriptorSetLayoutCreateInfo.bindingCount = 5; - descriptorSetLayoutCreateInfo.pBindings = layoutBindings; - result = vkCreateDescriptorSetLayout(rendererData->device, &descriptorSetLayoutCreateInfo, NULL, &rendererData->descriptorSetLayouts[i]); - if (result != VK_SUCCESS) { - VULKAN_DestroyAll(renderer); - SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreateDescriptorSetLayout(): %s\n", SDL_Vulkan_GetResultString(result)); - return result; - } - - /* Pipeline layout */ - VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = { 0 }; - VkPushConstantRange pushConstantRange; - pushConstantRange.size = sizeof( VertexShaderConstants ); - pushConstantRange.offset = 0; - pushConstantRange.stageFlags = VK_SHADER_STAGE_VERTEX_BIT; - pipelineLayoutCreateInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; - pipelineLayoutCreateInfo.setLayoutCount = 1; - pipelineLayoutCreateInfo.pSetLayouts = &rendererData->descriptorSetLayouts[i]; - pipelineLayoutCreateInfo.pushConstantRangeCount = 1; - pipelineLayoutCreateInfo.pPushConstantRanges = &pushConstantRange; - result = vkCreatePipelineLayout(rendererData->device, &pipelineLayoutCreateInfo, NULL, &rendererData->pipelineLayouts[i]); - if (result != VK_SUCCESS) { - VULKAN_DestroyAll(renderer); - SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreatePipelineLayout(): %s\n", SDL_Vulkan_GetResultString(result)); - return result; - } + /* Descriptor set layout / pipeline layout*/ + result = VULKAN_CreateDescriptorSetAndPipelineLayout(rendererData, VK_NULL_HANDLE, &rendererData->descriptorSetLayout, &rendererData->pipelineLayout); + if (result != VK_SUCCESS) { + VULKAN_DestroyAll(renderer); + SDL_LogError(SDL_LOG_CATEGORY_RENDER, "VULKAN_CreateDescriptorSetAndPipelineLayout(): %s\n", SDL_Vulkan_GetResultString(result)); + return result; } /* Create default vertex buffers */ @@ -2367,7 +2417,7 @@ static int VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD VkFormat textureFormat = SDLPixelFormatToVkTextureFormat(texture->format, renderer->output_colorspace); uint32_t width = texture->w; uint32_t height = texture->h; - + VkComponentMapping imageViewSwizzle = rendererData->identitySwizzle; if (textureFormat == VK_FORMAT_UNDEFINED) { return SDL_SetError("%s, An unsupported SDL pixel format (0x%x) was specified", __FUNCTION__, texture->format); } @@ -2384,13 +2434,120 @@ static int VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD } textureData->scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? VK_FILTER_NEAREST : VK_FILTER_LINEAR; - /* NV12 textures must have even width and height */ - if (texture->format == SDL_PIXELFORMAT_NV12 || +#if SDL_HAVE_YUV + /* YUV textures must have even width and height. Also create Ycbcr conversion */ + if (texture->format == SDL_PIXELFORMAT_YV12 || + texture->format == SDL_PIXELFORMAT_IYUV || + texture->format == SDL_PIXELFORMAT_NV12 || texture->format == SDL_PIXELFORMAT_NV21 || texture->format == SDL_PIXELFORMAT_P010) { + + /* Check that we have VK_KHR_sampler_ycbcr_conversion support */ + if (!rendererData->supportsKHRSamplerYcBcrConversion) { + SDL_free(textureData); + return SDL_SetError("[Vulkan] YUV textures require a Vulkan device that supports VK_KHR_sampler_ycbcr_conversion"); + } + VkSamplerYcbcrConversionCreateInfoKHR samplerYcbcrConversionCreateInfo = { 0 }; + samplerYcbcrConversionCreateInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_CREATE_INFO_KHR; + + /* Pad width/height to multiple of 2 */ width = (width + 1) & ~1; height = (height + 1) & ~1; + + /* Create samplerYcbcrConversion which will be used on the VkImageView and VkSampler */ + samplerYcbcrConversionCreateInfo.format = textureFormat; + switch (SDL_COLORSPACEPRIMARIES(texture->colorspace)) { + case SDL_COLOR_PRIMARIES_BT709: + samplerYcbcrConversionCreateInfo.ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_709_KHR; + break; + case SDL_COLOR_PRIMARIES_BT601: + samplerYcbcrConversionCreateInfo.ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_601_KHR; + break; + case SDL_COLOR_PRIMARIES_BT2020: + samplerYcbcrConversionCreateInfo.ycbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_YCBCR_2020_KHR; + default: + VULKAN_DestroyTexture(renderer, texture); + return SDL_SetError("[Vulkan] Unsupported Ycbcr colorspace.\n"); + } + samplerYcbcrConversionCreateInfo.components.r = VK_COMPONENT_SWIZZLE_IDENTITY; + samplerYcbcrConversionCreateInfo.components.g = VK_COMPONENT_SWIZZLE_IDENTITY; + samplerYcbcrConversionCreateInfo.components.b = VK_COMPONENT_SWIZZLE_IDENTITY; + samplerYcbcrConversionCreateInfo.components.a = VK_COMPONENT_SWIZZLE_IDENTITY; + if (texture->format == SDL_PIXELFORMAT_YV12 || + texture->format == SDL_PIXELFORMAT_NV21) { + samplerYcbcrConversionCreateInfo.components.r = VK_COMPONENT_SWIZZLE_B; + samplerYcbcrConversionCreateInfo.components.b = VK_COMPONENT_SWIZZLE_R; + } + + switch (SDL_COLORSPACERANGE(texture->colorspace)) { + case SDL_COLOR_RANGE_LIMITED: + samplerYcbcrConversionCreateInfo.ycbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_NARROW_KHR; + break; + case SDL_COLOR_RANGE_FULL: + default: + samplerYcbcrConversionCreateInfo.ycbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL_KHR; + break; + } + + switch (SDL_COLORSPACECHROMA(texture->colorspace)) { + case SDL_CHROMA_LOCATION_LEFT: + samplerYcbcrConversionCreateInfo.xChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN_KHR; + samplerYcbcrConversionCreateInfo.yChromaOffset = VK_CHROMA_LOCATION_MIDPOINT_KHR; + break; + case SDL_CHROMA_LOCATION_TOPLEFT: + samplerYcbcrConversionCreateInfo.xChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN_KHR; + samplerYcbcrConversionCreateInfo.yChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN_KHR; + break; + case SDL_CHROMA_LOCATION_NONE: + case SDL_CHROMA_LOCATION_CENTER: + default: + samplerYcbcrConversionCreateInfo.xChromaOffset = VK_CHROMA_LOCATION_MIDPOINT_KHR; + samplerYcbcrConversionCreateInfo.yChromaOffset = VK_CHROMA_LOCATION_MIDPOINT_KHR; + break; + } + samplerYcbcrConversionCreateInfo.chromaFilter = VK_FILTER_LINEAR; + samplerYcbcrConversionCreateInfo.forceExplicitReconstruction = VK_FALSE; + + result = vkCreateSamplerYcbcrConversionKHR(rendererData->device, &samplerYcbcrConversionCreateInfo, NULL, &textureData->samplerYcbcrConversion); + if (result != VK_SUCCESS) { + VULKAN_DestroyTexture(renderer, texture); + return SDL_SetError("[Vulkan] vkCreateSamplerYcbcrConversionKHR %s.\n", SDL_Vulkan_GetResultString(result)); + } + + /* 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.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; + samplerCreateInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + samplerCreateInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + samplerCreateInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + samplerCreateInfo.mipLodBias = 0.0f; + samplerCreateInfo.anisotropyEnable = VK_FALSE; + samplerCreateInfo.maxAnisotropy = 1.0f; + samplerCreateInfo.minLod = 0.0f; + samplerCreateInfo.maxLod = 1000.0f; + + VkSamplerYcbcrConversionInfoKHR samplerYcbcrConversionInfo = { 0 }; + samplerYcbcrConversionInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO_KHR; + samplerYcbcrConversionInfo.conversion = textureData->samplerYcbcrConversion; + samplerCreateInfo.pNext = &samplerYcbcrConversionInfo; + result = vkCreateSampler(rendererData->device, &samplerCreateInfo, NULL, &textureData->samplerYcbcr); + if (result != VK_SUCCESS) { + VULKAN_DestroyTexture(renderer, texture); + return SDL_SetError("[Vulkan] vkCreateSampler %s.\n", SDL_Vulkan_GetResultString(result)); + } + + /* Allocate special descriptor set layout with samplerYcbcr baked as an immutable sampler */ + result = VULKAN_CreateDescriptorSetAndPipelineLayout(rendererData, textureData->samplerYcbcr, + &textureData->descriptorSetLayoutYcbcr, &textureData->pipelineLayoutYcbcr); + if (result != VK_SUCCESS) { + VULKAN_DestroyTexture(renderer, texture); + return SDL_SetError("[Vulkan] VULKAN_CreateDescriptorSetAndPipelineLayout %s.\n", SDL_Vulkan_GetResultString(result)); + } } +#endif textureData->width = width; textureData->height = height; @@ -2403,7 +2560,7 @@ static int VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD return -1; } - result = VULKAN_AllocateImage(rendererData, width, height, textureFormat, usage, rendererData->identitySwizzle, externalImage, &textureData->mainImage); + result = VULKAN_AllocateImage(rendererData, width, height, textureFormat, usage, imageViewSwizzle, externalImage, textureData->samplerYcbcrConversion, &textureData->mainImage); if (result != VK_SUCCESS) { VULKAN_DestroyTexture(renderer, texture); SDL_LogError(SDL_LOG_CATEGORY_RENDER, "VULKAN_AllocateImage(): %s\n", SDL_Vulkan_GetResultString(result)); @@ -2412,85 +2569,6 @@ static int VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_VULKAN_TEXTURE_POINTER, &textureData->mainImage.image); - -#if SDL_HAVE_YUV - /* YUV Images */ - if (texture->format == SDL_PIXELFORMAT_YV12 || - texture->format == SDL_PIXELFORMAT_IYUV) { - textureData->yuv = SDL_TRUE; - - width = (width + 1) / 2; - height = (height + 1) / 2; - - /* Create U Image */ - if (GetTextureProperty(create_props, "vulkan.texture_u", &externalImage) < 0) { - return -1; - } - - result = VULKAN_AllocateImage(rendererData, width, height, textureFormat, usage, rendererData->identitySwizzle, externalImage, &textureData->mainImageU); - if (result != VK_SUCCESS) { - VULKAN_DestroyTexture(renderer, texture); - SDL_LogError(SDL_LOG_CATEGORY_RENDER, "VULKAN_AllocateImage(): %s\n", SDL_Vulkan_GetResultString(result)); - return result; - } - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_VULKAN_TEXTURE_U_POINTER, &textureData->mainImageU.image); - - /* Create V image */ - if (GetTextureProperty(create_props, "vulkan.texture_v", &externalImage) < 0) { - return -1; - } - result = VULKAN_AllocateImage(rendererData, width, height, textureFormat, usage, rendererData->identitySwizzle, externalImage, &textureData->mainImageV); - if (result != VK_SUCCESS) { - VULKAN_DestroyTexture(renderer, texture); - SDL_LogError(SDL_LOG_CATEGORY_RENDER, "VULKAN_AllocateImage(): %s\n", SDL_Vulkan_GetResultString(result)); - return result; - } - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_VULKAN_TEXTURE_V_POINTER, &textureData->mainImageV.image); - - textureData->YCbCr_matrix = SDL_GetYCbCRtoRGBConversionMatrix(texture->colorspace, texture->w, texture->h, 8); - if (!textureData->YCbCr_matrix) { - return SDL_SetError("Unsupported YUV colorspace"); - } - } - else if (texture->format == SDL_PIXELFORMAT_NV12 || - texture->format == SDL_PIXELFORMAT_NV21 || - texture->format == SDL_PIXELFORMAT_P010) { - int bits_per_pixel; - VkFormat uvFormat = VK_FORMAT_R8G8_UNORM; - if (texture->format == SDL_PIXELFORMAT_P010) { - uvFormat = VK_FORMAT_R16G16_UNORM; - } - textureData->nv12 = SDL_TRUE; - - width = (width + 1) / 2; - height = (height + 1) / 2; - - /* Allocate interleaved UV plane as R8G8 */ - result = VULKAN_AllocateImage(rendererData, width, height, uvFormat, usage, rendererData->identitySwizzle, VK_NULL_HANDLE, &textureData->mainImageUV); - if (result != VK_SUCCESS) { - VULKAN_DestroyTexture(renderer, texture); - SDL_LogError(SDL_LOG_CATEGORY_RENDER, "VULKAN_AllocateImage(): %s\n", SDL_Vulkan_GetResultString(result)); - return result; - } - - switch (texture->format) { - case SDL_PIXELFORMAT_P010: - bits_per_pixel = 10; - break; - default: - bits_per_pixel = 8; - break; - } - - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_VULKAN_TEXTURE_UV_POINTER, &textureData->mainImageUV.image); - - textureData->YCbCr_matrix = SDL_GetYCbCRtoRGBConversionMatrix(texture->colorspace, texture->w, texture->h, bits_per_pixel); - if (!textureData->YCbCr_matrix) { - return SDL_SetError("Unsupported YUV colorspace"); - } - } -#endif - if (texture->access == SDL_TEXTUREACCESS_TARGET) { result = VULKAN_CreateFramebuffersAndRenderPasses(renderer, texture->w, @@ -2527,9 +2605,22 @@ static void VULKAN_DestroyTexture(SDL_Renderer *renderer, VULKAN_DestroyImage(rendererData, &textureData->mainImage); #if SDL_HAVE_YUV - VULKAN_DestroyImage(rendererData, &textureData->mainImageU); - VULKAN_DestroyImage(rendererData, &textureData->mainImageV); - VULKAN_DestroyImage(rendererData, &textureData->mainImageUV); + if (textureData->samplerYcbcrConversion != VK_NULL_HANDLE) { + vkDestroySamplerYcbcrConversionKHR(rendererData->device, textureData->samplerYcbcrConversion, NULL); + textureData->samplerYcbcrConversion = VK_NULL_HANDLE; + } + if (textureData->samplerYcbcr != VK_NULL_HANDLE) { + vkDestroySampler(rendererData->device, textureData->samplerYcbcr, NULL); + textureData->samplerYcbcr = VK_NULL_HANDLE; + } + if (textureData->pipelineLayoutYcbcr != VK_NULL_HANDLE) { + vkDestroyPipelineLayout(rendererData->device, textureData->pipelineLayoutYcbcr, NULL); + textureData->pipelineLayoutYcbcr = VK_NULL_HANDLE; + } + if (textureData->descriptorSetLayoutYcbcr != VK_NULL_HANDLE) { + vkDestroyDescriptorSetLayout(rendererData->device, textureData->descriptorSetLayoutYcbcr, NULL); + textureData->descriptorSetLayoutYcbcr = VK_NULL_HANDLE; + } #endif VULKAN_DestroyBuffer(rendererData, &textureData->stagingBuffer); @@ -2556,6 +2647,7 @@ static VkResult VULKAN_UpdateTextureInternal(VULKAN_RenderData *rendererData, Vk const Uint8 *src; Uint8 *dst; VkResult result; + Uint32 planeCount = VULKAN_VkFormatGetNumPlanes(format); VULKAN_EnsureCommandBuffer(rendererData); @@ -2604,7 +2696,12 @@ static VkResult VULKAN_UpdateTextureInternal(VULKAN_RenderData *rendererData, Vk region.imageSubresource.baseArrayLayer = 0; region.imageSubresource.layerCount = 1; region.imageSubresource.mipLevel = 0; - region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + if (planeCount <= 1) { + region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + } + else { + region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_PLANE_0_BIT << plane; + } region.imageOffset.x = x; region.imageOffset.y = y; region.imageOffset.z = 0; @@ -2650,59 +2747,28 @@ static int VULKAN_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, return -1; } #if SDL_HAVE_YUV - if (textureData->yuv) { - /* Skip to the correct offset into the next texture */ - srcPixels = (const void *)((const Uint8 *)srcPixels + rect->h * srcPitch); + Uint32 numPlanes = VULKAN_VkFormatGetNumPlanes(textureData->mainImage.format); + /* Skip to the correct offset into the next texture */ + srcPixels = (const void *)((const Uint8 *)srcPixels + rect->h * srcPitch); + // YUV data + if (numPlanes == 3) { + for (Uint32 plane = 1; plane < numPlanes; plane++) { + if (VULKAN_UpdateTextureInternal(rendererData, textureData->mainImage.image, textureData->mainImage.format, plane, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, srcPixels, (srcPitch + 1) / 2, &textureData->mainImage.imageLayout) < 0) { + return -1; + } - if (VULKAN_UpdateTextureInternal(rendererData, - texture->format == SDL_PIXELFORMAT_YV12 ? textureData->mainImageV.image : textureData->mainImageU.image, - textureData->mainImageU.format, - 0, - rect->x / 2, - rect->y / 2, - (rect->w + 1) / 2, - (rect->h + 1) / 2, - srcPixels, - (srcPitch + 1) / 2, - texture->format == SDL_PIXELFORMAT_YV12 ? &textureData->mainImageV.imageLayout : &textureData->mainImageU.imageLayout) < 0) { - return -1; - } - - /* Skip to the correct offset into the next texture */ - srcPixels = (const void *)((const Uint8 *)srcPixels + ((rect->h + 1) / 2) * ((srcPitch + 1) / 2)); - if (VULKAN_UpdateTextureInternal(rendererData, - texture->format == SDL_PIXELFORMAT_YV12 ? textureData->mainImageU.image : textureData->mainImageV.image, - textureData->mainImageV.format, - 0, - rect->x / 2, - rect->y / 2, - (rect->w + 1) / 2, - (rect->h + 1) / 2, - srcPixels, - (srcPitch + 1) / 2, - texture->format == SDL_PIXELFORMAT_YV12 ? &textureData->mainImageU.imageLayout : &textureData->mainImageV.imageLayout) < 0) { - return -1; + /* Skip to the correct offset into the next texture */ + srcPixels = (const void *)((const Uint8 *)srcPixels + ((rect->h + 1) / 2) * ((srcPitch + 1) / 2)); } } - if (textureData->nv12) { - /* Skip to the correct offset into the next texture */ - srcPixels = (const void *)((const Uint8 *)srcPixels + rect->h * srcPitch); - - if (VULKAN_UpdateTextureInternal(rendererData, - textureData->mainImageUV.image, - textureData->mainImageUV.format, - 1, - rect->x / 2, - rect->y / 2, - (rect->w + 1) / 2, - (rect->h + 1) / 2, - srcPixels, - srcPitch, - &textureData->mainImageUV.imageLayout) < 0) { - return -1; + // NV12/NV21 data + else if (numPlanes == 2) + { + if (VULKAN_UpdateTextureInternal(rendererData, textureData->mainImage.image, textureData->mainImage.format, 1, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, srcPixels, (srcPitch + 1) & ~1, &textureData->mainImage.imageLayout) < 0) { + return -1; } } -#endif /* SDL_HAVE_YUV */ +#endif return 0; } @@ -2723,10 +2789,10 @@ static int VULKAN_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, if (VULKAN_UpdateTextureInternal(rendererData, textureData->mainImage.image, textureData->mainImage.format, 0, rect->x, rect->y, rect->w, rect->h, Yplane, Ypitch, &textureData->mainImage.imageLayout) < 0) { return -1; } - if (VULKAN_UpdateTextureInternal(rendererData, textureData->mainImageU.image, textureData->mainImageU.format, 0, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Uplane, Upitch, &textureData->mainImageU.imageLayout) < 0) { + if (VULKAN_UpdateTextureInternal(rendererData, textureData->mainImage.image, textureData->mainImage.format, 1, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Uplane, Upitch, &textureData->mainImage.imageLayout) < 0) { return -1; } - if (VULKAN_UpdateTextureInternal(rendererData, textureData->mainImageV.image, textureData->mainImageV.format, 0, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Vplane, Vpitch, &textureData->mainImageV.imageLayout) < 0) { + if (VULKAN_UpdateTextureInternal(rendererData, textureData->mainImage.image, textureData->mainImage.format, 2, rect->x / 2, rect->y / 2, rect->w / 2, rect->h / 2, Vplane, Vpitch, &textureData->mainImage.imageLayout) < 0) { return -1; } return 0; @@ -2748,7 +2814,7 @@ static int VULKAN_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, return -1; } - if (VULKAN_UpdateTextureInternal(rendererData, textureData->mainImageUV.image, textureData->mainImageUV.format, 1, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, UVplane, UVpitch, &textureData->mainImageUV.imageLayout) < 0) { + if (VULKAN_UpdateTextureInternal(rendererData, textureData->mainImage.image, textureData->mainImage.format, 1, rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2, UVplane, UVpitch, &textureData->mainImage.imageLayout) < 0) { return -1; } return 0; @@ -3107,23 +3173,14 @@ static void VULKAN_SetupShaderConstants(SDL_Renderer *renderer, const SDL_Render switch (texture->format) { case SDL_PIXELFORMAT_YV12: case SDL_PIXELFORMAT_IYUV: - constants->texture_type = TEXTURETYPE_YUV; - constants->input_type = INPUTTYPE_SRGB; - break; case SDL_PIXELFORMAT_NV12: - constants->texture_type = TEXTURETYPE_NV12; - constants->input_type = INPUTTYPE_SRGB; - break; case SDL_PIXELFORMAT_NV21: - constants->texture_type = TEXTURETYPE_NV21; constants->input_type = INPUTTYPE_SRGB; break; case SDL_PIXELFORMAT_P010: - constants->texture_type = TEXTURETYPE_NV12; constants->input_type = INPUTTYPE_HDR10; break; default: - constants->texture_type = TEXTURETYPE_RGB; if (texture->colorspace == SDL_COLORSPACE_SRGB_LINEAR) { constants->input_type = INPUTTYPE_SCRGB; } else if (SDL_COLORSPACEPRIMARIES(texture->colorspace) == SDL_COLOR_PRIMARIES_BT2020 && @@ -3163,10 +3220,8 @@ static VkDescriptorPool VULKAN_AllocateDescriptorPool(VULKAN_RenderData *rendere descriptorPoolSizes[0].descriptorCount = SDL_VULKAN_MAX_DESCRIPTOR_SETS; descriptorPoolSizes[0].type = VK_DESCRIPTOR_TYPE_SAMPLER; - /* Allocate enough to hold a maximum of each descriptor set having YUV textures */ - const int numTexturesPerYUV = 3; - descriptorPoolSizes[1].descriptorCount = SDL_VULKAN_MAX_DESCRIPTOR_SETS * numTexturesPerYUV; - descriptorPoolSizes[1].type = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; + descriptorPoolSizes[1].descriptorCount = SDL_VULKAN_MAX_DESCRIPTOR_SETS; + descriptorPoolSizes[1].type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; VkDescriptorPoolCreateInfo descriptorPoolCreateInfo = { 0 }; descriptorPoolCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; @@ -3182,7 +3237,60 @@ static VkDescriptorPool VULKAN_AllocateDescriptorPool(VULKAN_RenderData *rendere return descriptorPool; } -static VkDescriptorSet VULKAN_AllocateDescriptorSet(SDL_Renderer *renderer, VULKAN_Shader shader, VkSampler sampler, VkBuffer constantBuffer, VkDeviceSize constantBufferOffset, int imageViewCount, VkImageView *imageViews) +static VkResult VULKAN_CreateDescriptorSetAndPipelineLayout(VULKAN_RenderData *rendererData, VkSampler samplerYcbcr, VkDescriptorSetLayout *descriptorSetLayoutOut, + VkPipelineLayout *pipelineLayoutOut) +{ + VkResult result; + + /* Descriptor set layout */ + VkDescriptorSetLayoutCreateInfo descriptorSetLayoutCreateInfo = { 0 }; + descriptorSetLayoutCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; + descriptorSetLayoutCreateInfo.flags = 0; + VkDescriptorSetLayoutBinding layoutBindings[2]; + /* PixelShaderConstants */ + layoutBindings[0].binding = 1; + layoutBindings[0].descriptorCount = 1; + layoutBindings[0].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; + layoutBindings[0].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; + layoutBindings[0].pImmutableSamplers = NULL; + + /* Combined image/sampler */ + layoutBindings[1].binding = 0; + layoutBindings[1].descriptorCount = 1; + layoutBindings[1].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + layoutBindings[1].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; + layoutBindings[1].pImmutableSamplers = (samplerYcbcr != VK_NULL_HANDLE) ? &samplerYcbcr : NULL; + + descriptorSetLayoutCreateInfo.bindingCount = 2; + descriptorSetLayoutCreateInfo.pBindings = layoutBindings; + result = vkCreateDescriptorSetLayout(rendererData->device, &descriptorSetLayoutCreateInfo, NULL, descriptorSetLayoutOut); + if (result != VK_SUCCESS) { + SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreateDescriptorSetLayout(): %s\n", SDL_Vulkan_GetResultString(result)); + return result; + } + + /* Pipeline layout */ + VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = { 0 }; + VkPushConstantRange pushConstantRange; + pushConstantRange.size = sizeof( VertexShaderConstants ); + pushConstantRange.offset = 0; + pushConstantRange.stageFlags = VK_SHADER_STAGE_VERTEX_BIT; + pipelineLayoutCreateInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO; + pipelineLayoutCreateInfo.setLayoutCount = 1; + pipelineLayoutCreateInfo.pSetLayouts = descriptorSetLayoutOut; + pipelineLayoutCreateInfo.pushConstantRangeCount = 1; + pipelineLayoutCreateInfo.pPushConstantRanges = &pushConstantRange; + result = vkCreatePipelineLayout(rendererData->device, &pipelineLayoutCreateInfo, NULL, pipelineLayoutOut); + if (result != VK_SUCCESS) { + SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreatePipelineLayout(): %s\n", SDL_Vulkan_GetResultString(result)); + return result; + } + + return result; +} + +static VkDescriptorSet VULKAN_AllocateDescriptorSet(SDL_Renderer *renderer, VULKAN_Shader shader, VkDescriptorSetLayout descriptorSetLayout, + VkSampler sampler, VkBuffer constantBuffer, VkDeviceSize constantBufferOffset, VkImageView imageView) { VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; uint32_t currentDescriptorPoolIndex = rendererData->currentDescriptorPoolIndex; @@ -3192,7 +3300,7 @@ static VkDescriptorSet VULKAN_AllocateDescriptorSet(SDL_Renderer *renderer, VULK descriptorSetAllocateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO; descriptorSetAllocateInfo.descriptorSetCount = 1; descriptorSetAllocateInfo.descriptorPool = descriptorPool; - descriptorSetAllocateInfo.pSetLayouts = &rendererData->descriptorSetLayouts[shader]; + descriptorSetAllocateInfo.pSetLayouts = &descriptorSetLayout; VkDescriptorSet descriptorSet = VK_NULL_HANDLE; VkResult result = (rendererData->currentDescriptorSetIndex >= SDL_VULKAN_MAX_DESCRIPTOR_SETS) ? VK_ERROR_OUT_OF_DEVICE_MEMORY : VK_SUCCESS; @@ -3231,71 +3339,58 @@ static VkDescriptorSet VULKAN_AllocateDescriptorSet(SDL_Renderer *renderer, VULK rendererData->currentDescriptorSetIndex = 0; /* Call recursively to allocate from the new pool */ - return VULKAN_AllocateDescriptorSet(renderer, shader, sampler, constantBuffer, constantBufferOffset, imageViewCount, imageViews); + return VULKAN_AllocateDescriptorSet(renderer, shader, descriptorSetLayout, sampler, constantBuffer, constantBufferOffset, imageView); } } rendererData->currentDescriptorSetIndex++; - VkDescriptorImageInfo samplerDescriptor = { 0 }; - samplerDescriptor.sampler = sampler; - - VkDescriptorImageInfo imageDescriptors[3]; - SDL_memset(imageDescriptors, 0, sizeof(imageDescriptors)); + VkDescriptorImageInfo combinedImageSamplerDescriptor = { 0 }; VkDescriptorBufferInfo bufferDescriptor = { 0 }; bufferDescriptor.buffer = constantBuffer; bufferDescriptor.offset = constantBufferOffset; bufferDescriptor.range = sizeof(PixelShaderConstants); - VkWriteDescriptorSet descriptorWrites[5]; + VkWriteDescriptorSet descriptorWrites[2]; SDL_memset(descriptorWrites, 0, sizeof(descriptorWrites)); uint32_t descriptorCount = 1; /* Always have the uniform buffer */ descriptorWrites[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; descriptorWrites[0].dstSet = descriptorSet; - descriptorWrites[0].dstBinding = 4; + descriptorWrites[0].dstBinding = 1; descriptorWrites[0].dstArrayElement = 0; descriptorWrites[0].descriptorCount = 1; descriptorWrites[0].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; descriptorWrites[0].pBufferInfo = &bufferDescriptor; - if (sampler != VK_NULL_HANDLE) { + if (sampler != VK_NULL_HANDLE && imageView != VK_NULL_HANDLE) { descriptorCount++; descriptorWrites[1].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; descriptorWrites[1].dstSet = descriptorSet; descriptorWrites[1].dstBinding = 0; descriptorWrites[1].dstArrayElement = 0; descriptorWrites[1].descriptorCount = 1; - descriptorWrites[1].descriptorType = VK_DESCRIPTOR_TYPE_SAMPLER; - descriptorWrites[1].pImageInfo = &samplerDescriptor; + descriptorWrites[1].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + descriptorWrites[1].pImageInfo = &combinedImageSamplerDescriptor; + + /* Ignore the sampler if we're using YcBcCr data since it will be baked in the descriptor set layout */ + if (descriptorSetLayout == rendererData->descriptorSetLayout) { + combinedImageSamplerDescriptor.sampler = sampler; + } + combinedImageSamplerDescriptor.imageView = imageView; + combinedImageSamplerDescriptor.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; } - uint32_t startImageViews = descriptorCount; - for (int i = 0; i < 3 && imageViewCount > 0; i++) { - descriptorCount++; - imageDescriptors[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; - /* There are up to 3 images in the shader, if we haven't specified that many, duplicate the first - one. There is dynamic branching that determines how many actually get fetched, but we need - them all populated for validation. */ - imageDescriptors[i].imageView = (i < imageViewCount) ? imageViews[i] : imageViews[0]; - descriptorWrites[i+startImageViews].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; - descriptorWrites[i+startImageViews].dstSet = descriptorSet; - descriptorWrites[i+startImageViews].dstBinding = 1 + i; - descriptorWrites[i+startImageViews].dstArrayElement = 0; - descriptorWrites[i+startImageViews].descriptorCount = 1; - descriptorWrites[i+startImageViews].descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE; - descriptorWrites[i+startImageViews].pImageInfo = &imageDescriptors[i]; - } vkUpdateDescriptorSets(rendererData->device, descriptorCount, descriptorWrites, 0, NULL); return descriptorSet; } -static SDL_bool VULKAN_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, VULKAN_Shader shader, const PixelShaderConstants *shader_constants, - VkPrimitiveTopology topology, int imageViewCount, VkImageView *imageViews, VkSampler sampler, const Float4X4 *matrix, VULKAN_DrawStateCache *stateCache) +static SDL_bool VULKAN_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, VULKAN_Shader shader, VkPipelineLayout pipelineLayout, VkDescriptorSetLayout descriptorSetLayout, + const PixelShaderConstants *shader_constants, VkPrimitiveTopology topology, VkImageView imageView, VkSampler sampler, const Float4X4 *matrix, VULKAN_DrawStateCache *stateCache) { VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; const SDL_BlendMode blendMode = cmd->data.draw.blend; - VkFormat format = rendererData->surfaceFormat.format; // TEMP + VkFormat format = rendererData->surfaceFormat.format; const Float4X4 *newmatrix = matrix ? matrix : &rendererData->identity; SDL_bool updateConstants = SDL_FALSE; PixelShaderConstants solid_constants; @@ -3313,7 +3408,9 @@ static SDL_bool VULKAN_SetDrawState(SDL_Renderer *renderer, const SDL_RenderComm rendererData->currentPipelineState->shader != shader || rendererData->currentPipelineState->blendMode != blendMode || rendererData->currentPipelineState->topology != topology || - rendererData->currentPipelineState->format != format) { + rendererData->currentPipelineState->format != format || + rendererData->currentPipelineState->pipelineLayout != pipelineLayout || + rendererData->currentPipelineState->descriptorSetLayout != descriptorSetLayout) { rendererData->currentPipelineState = NULL; for (i = 0; i < rendererData->pipelineStateCount; ++i) { @@ -3321,7 +3418,9 @@ static SDL_bool VULKAN_SetDrawState(SDL_Renderer *renderer, const SDL_RenderComm if (candidatePiplineState->shader == shader && candidatePiplineState->blendMode == blendMode && candidatePiplineState->topology == topology && - candidatePiplineState->format == format) { + candidatePiplineState->format == format && + candidatePiplineState->pipelineLayout == pipelineLayout && + candidatePiplineState->descriptorSetLayout == descriptorSetLayout) { rendererData->currentPipelineState = candidatePiplineState; break; } @@ -3329,7 +3428,7 @@ static SDL_bool VULKAN_SetDrawState(SDL_Renderer *renderer, const SDL_RenderComm /* If we didn't find a match, create a new one -- it must mean the blend mode is non-standard */ if (!rendererData->currentPipelineState) { - rendererData->currentPipelineState = VULKAN_CreatePipelineState(renderer, shader, blendMode, topology, format); + rendererData->currentPipelineState = VULKAN_CreatePipelineState(renderer, shader, pipelineLayout, descriptorSetLayout, blendMode, topology, format); } if (!rendererData->currentPipelineState) { @@ -3421,7 +3520,7 @@ static SDL_bool VULKAN_SetDrawState(SDL_Renderer *renderer, const SDL_RenderComm } /* Allocate/update descriptor set with the bindings */ - descriptorSet = VULKAN_AllocateDescriptorSet(renderer, shader, sampler, constantBuffer, constantBufferOffset, imageViewCount, imageViews); + descriptorSet = VULKAN_AllocateDescriptorSet(renderer, shader, descriptorSetLayout, sampler, constantBuffer, constantBufferOffset, imageView); if (descriptorSet == VK_NULL_HANDLE) { return SDL_FALSE; } @@ -3441,6 +3540,8 @@ static SDL_bool VULKAN_SetCopyState(SDL_Renderer *renderer, const SDL_RenderComm VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->driverdata; VkSampler textureSampler = VK_NULL_HANDLE; PixelShaderConstants constants; + VkDescriptorSetLayout descriptorSetLayout = (textureData->descriptorSetLayoutYcbcr != VK_NULL_HANDLE) ? textureData->descriptorSetLayoutYcbcr : rendererData->descriptorSetLayout; + VkPipelineLayout pipelineLayout = (textureData->pipelineLayoutYcbcr != VK_NULL_HANDLE) ? textureData->pipelineLayoutYcbcr : rendererData->pipelineLayout; VULKAN_SetupShaderConstants(renderer, cmd, texture, &constants); @@ -3455,7 +3556,6 @@ static SDL_bool VULKAN_SetCopyState(SDL_Renderer *renderer, const SDL_RenderComm return SDL_SetError("Unknown scale mode: %d\n", textureData->scaleMode); } - if (textureData->mainImage.imageLayout != VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL) { SDL_bool stoppedRenderPass = SDL_FALSE; if (rendererData->currentRenderPass != VK_NULL_HANDLE) { @@ -3478,57 +3578,7 @@ static SDL_bool VULKAN_SetCopyState(SDL_Renderer *renderer, const SDL_RenderComm } } -#if SDL_HAVE_YUV - if (textureData->yuv) { - - /* Make sure each texture is in the correct state to be accessed by the pixel shader. */ - VULKAN_RecordPipelineImageBarrier(rendererData, - VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - VK_ACCESS_SHADER_READ_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, - textureData->mainImageU.image, - &textureData->mainImageU.imageLayout); - VULKAN_RecordPipelineImageBarrier(rendererData, - VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - VK_ACCESS_SHADER_READ_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, - textureData->mainImageV.image, - &textureData->mainImageV.imageLayout); - - VkImageView imageViews[3] = { - textureData->mainImage.imageView, - textureData->mainImageU.imageView, - textureData->mainImageV.imageView - }; - - return VULKAN_SetDrawState(renderer, cmd, textureData->shader, &constants, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, SDL_arraysize(imageViews), imageViews, - textureSampler, matrix, stateCache); - } else if (textureData->nv12) { - - /* Make sure each texture is in the correct state to be accessed by the pixel shader. */ - VULKAN_RecordPipelineImageBarrier(rendererData, - VK_ACCESS_TRANSFER_WRITE_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, - VK_ACCESS_SHADER_READ_BIT, - VK_PIPELINE_STAGE_TRANSFER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, - textureData->mainImageUV.image, - &textureData->mainImageUV.imageLayout); - - VkImageView imageViews[2] = { - textureData->mainImage.imageView, - textureData->mainImageUV.imageView, - }; - - return VULKAN_SetDrawState(renderer, cmd, textureData->shader, &constants, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, SDL_arraysize(imageViews), imageViews, - textureSampler, matrix, stateCache); - } -#endif - return VULKAN_SetDrawState(renderer, cmd, textureData->shader, &constants, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 1, &textureData->mainImage.imageView, textureSampler, matrix, stateCache); + return VULKAN_SetDrawState(renderer, cmd, textureData->shader, pipelineLayout, descriptorSetLayout, &constants, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, textureData->mainImage.imageView, textureSampler, matrix, stateCache); } static void VULKAN_DrawPrimitives(SDL_Renderer *renderer, VkPrimitiveTopology primitiveTopology, const size_t vertexStart, const size_t vertexCount) @@ -3618,7 +3668,7 @@ static int VULKAN_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd const size_t count = cmd->data.draw.count; const size_t first = cmd->data.draw.first; const size_t start = first / sizeof(VertexPositionColor); - VULKAN_SetDrawState(renderer, cmd, SHADER_SOLID, NULL, VK_PRIMITIVE_TOPOLOGY_POINT_LIST, 0, NULL, VK_NULL_HANDLE, NULL, &stateCache); + VULKAN_SetDrawState(renderer, cmd, SHADER_SOLID, rendererData->pipelineLayout, rendererData->descriptorSetLayout, NULL, VK_PRIMITIVE_TOPOLOGY_POINT_LIST, VK_NULL_HANDLE, VK_NULL_HANDLE, NULL, &stateCache); VULKAN_DrawPrimitives(renderer, VK_PRIMITIVE_TOPOLOGY_POINT_LIST, start, count); break; } @@ -3629,10 +3679,10 @@ static int VULKAN_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd const size_t first = cmd->data.draw.first; const size_t start = first / sizeof(VertexPositionColor); const VertexPositionColor *verts = (VertexPositionColor *)(((Uint8 *)vertices) + first); - VULKAN_SetDrawState(renderer, cmd, SHADER_SOLID, NULL, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, 0, NULL, VK_NULL_HANDLE, NULL, &stateCache); + VULKAN_SetDrawState(renderer, cmd, SHADER_SOLID, rendererData->pipelineLayout, rendererData->descriptorSetLayout, NULL, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, VK_NULL_HANDLE, VK_NULL_HANDLE, NULL, &stateCache); VULKAN_DrawPrimitives(renderer, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, start, count); if (verts[0].pos[0] != verts[count - 1].pos[0] || verts[0].pos[1] != verts[count - 1].pos[1]) { - VULKAN_SetDrawState(renderer, cmd, SHADER_SOLID, NULL, VK_PRIMITIVE_TOPOLOGY_POINT_LIST, 0, NULL, VK_NULL_HANDLE, NULL, &stateCache); + VULKAN_SetDrawState(renderer, cmd, SHADER_SOLID, rendererData->pipelineLayout, rendererData->descriptorSetLayout, NULL, VK_PRIMITIVE_TOPOLOGY_POINT_LIST, VK_NULL_HANDLE, VK_NULL_HANDLE, NULL, &stateCache); VULKAN_DrawPrimitives(renderer, VK_PRIMITIVE_TOPOLOGY_POINT_LIST, start + (count - 1), 1); } break; @@ -3657,7 +3707,7 @@ static int VULKAN_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd if (texture) { VULKAN_SetCopyState(renderer, cmd, NULL, &stateCache); } else { - VULKAN_SetDrawState(renderer, cmd, SHADER_SOLID, NULL, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 0, NULL, VK_NULL_HANDLE, NULL, &stateCache); + VULKAN_SetDrawState(renderer, cmd, SHADER_SOLID, rendererData->pipelineLayout, rendererData->descriptorSetLayout, NULL, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, VK_NULL_HANDLE, VK_NULL_HANDLE, NULL, &stateCache); } VULKAN_DrawPrimitives(renderer, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, start, count); diff --git a/src/render/vulkan/VULKAN_PixelShader_Advanced.h b/src/render/vulkan/VULKAN_PixelShader_Advanced.h index 9a100f27a..0ac041591 100644 --- a/src/render/vulkan/VULKAN_PixelShader_Advanced.h +++ b/src/render/vulkan/VULKAN_PixelShader_Advanced.h @@ -1,25 +1,23 @@ // 1113.1.1 #pragma once const uint32_t VULKAN_PixelShader_Advanced[] = { - 0x07230203,0x00010000,0x0008000b,0x000005e4,0x00000000,0x00020011,0x00000001,0x0006000b, + 0x07230203,0x00010000,0x0008000b,0x0000043e,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, - 0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000275,0x00000278,0x0000027c, + 0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x000001bb,0x000001be,0x000001c2, 0x00030010,0x00000004,0x00000007,0x00030003,0x00000005,0x000001f4,0x00040005,0x00000004, 0x6e69616d,0x00000000,0x00050005,0x00000075,0x736e6f43,0x746e6174,0x00000073,0x00070006, - 0x00000075,0x00000000,0x47526373,0x756f5f42,0x74757074,0x00000000,0x00070006,0x00000075, - 0x00000001,0x74786574,0x5f657275,0x65707974,0x00000000,0x00060006,0x00000075,0x00000002, - 0x75706e69,0x79745f74,0x00006570,0x00060006,0x00000075,0x00000003,0x6f6c6f63,0x63735f72, - 0x00656c61,0x00070006,0x00000075,0x00000004,0x656e6f74,0x5f70616d,0x6874656d,0x0000646f, - 0x00070006,0x00000075,0x00000005,0x656e6f74,0x5f70616d,0x74636166,0x0031726f,0x00070006, - 0x00000075,0x00000006,0x656e6f74,0x5f70616d,0x74636166,0x0032726f,0x00070006,0x00000075, - 0x00000007,0x5f726473,0x74696877,0x6f705f65,0x00746e69,0x00050006,0x00000075,0x00000008, - 0x66666f59,0x00746573,0x00050006,0x00000075,0x00000009,0x656f6352,0x00006666,0x00050006, - 0x00000075,0x0000000a,0x656f6347,0x00006666,0x00050006,0x00000075,0x0000000b,0x656f6342, - 0x00006666,0x00030005,0x00000077,0x00000000,0x00050005,0x000000f2,0x74786574,0x30657275, - 0x00000000,0x00050005,0x000000f6,0x706d6173,0x3072656c,0x00000000,0x00050005,0x0000010d, - 0x74786574,0x31657275,0x00000000,0x00050005,0x00000182,0x74786574,0x32657275,0x00000000, - 0x00050005,0x00000275,0x75706e69,0x65742e74,0x00000078,0x00050005,0x00000278,0x75706e69, - 0x6f632e74,0x00726f6c,0x00070005,0x0000027c,0x746e6540,0x6f507972,0x4f746e69,0x75707475, + 0x00000075,0x00000000,0x47526373,0x756f5f42,0x74757074,0x00000000,0x00060006,0x00000075, + 0x00000001,0x75706e69,0x79745f74,0x00006570,0x00060006,0x00000075,0x00000002,0x6f6c6f63, + 0x63735f72,0x00656c61,0x00060006,0x00000075,0x00000003,0x73756e75,0x705f6465,0x00306461, + 0x00070006,0x00000075,0x00000004,0x656e6f74,0x5f70616d,0x6874656d,0x0000646f,0x00070006, + 0x00000075,0x00000005,0x656e6f74,0x5f70616d,0x74636166,0x0031726f,0x00070006,0x00000075, + 0x00000006,0x656e6f74,0x5f70616d,0x74636166,0x0032726f,0x00070006,0x00000075,0x00000007, + 0x5f726473,0x74696877,0x6f705f65,0x00746e69,0x00050006,0x00000075,0x00000008,0x66666f59, + 0x00746573,0x00050006,0x00000075,0x00000009,0x656f6352,0x00006666,0x00050006,0x00000075, + 0x0000000a,0x656f6347,0x00006666,0x00050006,0x00000075,0x0000000b,0x656f6342,0x00006666, + 0x00030005,0x00000077,0x00000000,0x00050005,0x000000e6,0x74786574,0x30657275,0x00000000, + 0x00050005,0x000001bb,0x75706e69,0x65742e74,0x00000078,0x00050005,0x000001be,0x75706e69, + 0x6f632e74,0x00726f6c,0x00070005,0x000001c2,0x746e6540,0x6f507972,0x4f746e69,0x75707475, 0x00000074,0x00050048,0x00000075,0x00000000,0x00000023,0x00000000,0x00050048,0x00000075, 0x00000001,0x00000023,0x00000004,0x00050048,0x00000075,0x00000002,0x00000023,0x00000008, 0x00050048,0x00000075,0x00000003,0x00000023,0x0000000c,0x00050048,0x00000075,0x00000004, @@ -28,13 +26,10 @@ const uint32_t VULKAN_PixelShader_Advanced[] = { 0x0000001c,0x00050048,0x00000075,0x00000008,0x00000023,0x00000020,0x00050048,0x00000075, 0x00000009,0x00000023,0x00000030,0x00050048,0x00000075,0x0000000a,0x00000023,0x00000040, 0x00050048,0x00000075,0x0000000b,0x00000023,0x00000050,0x00030047,0x00000075,0x00000002, - 0x00040047,0x00000077,0x00000022,0x00000000,0x00040047,0x00000077,0x00000021,0x00000004, - 0x00040047,0x000000f2,0x00000022,0x00000000,0x00040047,0x000000f2,0x00000021,0x00000001, - 0x00040047,0x000000f6,0x00000022,0x00000000,0x00040047,0x000000f6,0x00000021,0x00000000, - 0x00040047,0x0000010d,0x00000022,0x00000000,0x00040047,0x0000010d,0x00000021,0x00000002, - 0x00040047,0x00000182,0x00000022,0x00000000,0x00040047,0x00000182,0x00000021,0x00000003, - 0x00040047,0x00000275,0x0000001e,0x00000000,0x00040047,0x00000278,0x0000001e,0x00000001, - 0x00040047,0x0000027c,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003, + 0x00040047,0x00000077,0x00000022,0x00000000,0x00040047,0x00000077,0x00000021,0x00000001, + 0x00040047,0x000000e6,0x00000022,0x00000000,0x00040047,0x000000e6,0x00000021,0x00000000, + 0x00040047,0x000001bb,0x0000001e,0x00000000,0x00040047,0x000001be,0x0000001e,0x00000001, + 0x00040047,0x000001c2,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003, 0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x0000000f,0x00000006,0x00000003, 0x00040017,0x00000018,0x00000006,0x00000004,0x00040017,0x00000019,0x00000006,0x00000002, 0x0004002b,0x00000006,0x00000032,0x3d25aee6,0x00020014,0x00000033,0x0004002b,0x00000006, @@ -53,7 +48,7 @@ const uint32_t VULKAN_PixelShader_Advanced[] = { 0x00000079,0x00000007,0x00040020,0x0000007a,0x00000002,0x00000006,0x0004002b,0x00000078, 0x00000081,0x00000004,0x0004002b,0x00000006,0x00000084,0x3f800000,0x0004002b,0x00000078, 0x00000088,0x00000005,0x0004002b,0x00000006,0x00000090,0x40000000,0x0004002b,0x00000078, - 0x00000094,0x00000002,0x00040018,0x0000009b,0x0000000f,0x00000003,0x0004002b,0x00000006, + 0x00000094,0x00000001,0x00040018,0x0000009b,0x0000000f,0x00000003,0x0004002b,0x00000006, 0x0000009c,0x3f209d8c,0x0004002b,0x00000006,0x0000009d,0x3ea897c8,0x0004002b,0x00000006, 0x0000009e,0x3d3168f9,0x0006002c,0x0000000f,0x0000009f,0x0000009c,0x0000009d,0x0000009e, 0x0004002b,0x00000006,0x000000a0,0x3d8d82ba,0x0004002b,0x00000006,0x000000a1,0x3f6b670a, @@ -69,305 +64,214 @@ const uint32_t VULKAN_PixelShader_Advanced[] = { 0x000000d6,0x000000d7,0x0004002b,0x00000006,0x000000d9,0xbc94b7b3,0x0004002b,0x00000006, 0x000000da,0xbdce05cd,0x0004002b,0x00000006,0x000000db,0x3f8f333c,0x0006002c,0x0000000f, 0x000000dc,0x000000d9,0x000000da,0x000000db,0x0006002c,0x0000009b,0x000000dd,0x000000d4, - 0x000000d8,0x000000dc,0x0004002b,0x00000078,0x000000e2,0x00000001,0x0007002c,0x00000018, - 0x000000e9,0x00000084,0x00000084,0x00000084,0x00000084,0x00090019,0x000000f0,0x00000006, - 0x00000001,0x00000000,0x00000000,0x00000000,0x00000001,0x00000000,0x00040020,0x000000f1, - 0x00000000,0x000000f0,0x0004003b,0x000000f1,0x000000f2,0x00000000,0x0002001a,0x000000f4, - 0x00040020,0x000000f5,0x00000000,0x000000f4,0x0004003b,0x000000f5,0x000000f6,0x00000000, - 0x0003001b,0x000000f8,0x000000f0,0x0004003b,0x000000f1,0x0000010d,0x00000000,0x0004002b, - 0x00000078,0x00000119,0x00000008,0x00040020,0x0000011a,0x00000002,0x00000018,0x0004002b, - 0x00000078,0x00000121,0x00000009,0x0004002b,0x00000078,0x00000128,0x0000000a,0x0004002b, - 0x00000078,0x0000012f,0x0000000b,0x0004002b,0x00000006,0x0000013a,0x40400000,0x0004002b, - 0x00000006,0x0000016d,0x40800000,0x0004003b,0x000000f1,0x00000182,0x00000000,0x0004002b, - 0x00000078,0x000001ae,0x00000003,0x0004002b,0x00000078,0x000001be,0x00000000,0x00040020, - 0x00000270,0x00000001,0x00000018,0x00040020,0x00000274,0x00000001,0x00000019,0x0004003b, - 0x00000274,0x00000275,0x00000001,0x0004003b,0x00000270,0x00000278,0x00000001,0x00040020, - 0x0000027b,0x00000003,0x00000018,0x0004003b,0x0000027b,0x0000027c,0x00000003,0x0006002c, - 0x0000000f,0x0000059a,0x0000005d,0x0000005d,0x0000005d,0x0006002c,0x0000000f,0x0000059b, - 0x00000064,0x00000064,0x00000064,0x0006002c,0x0000000f,0x000005a0,0x00000084,0x00000084, - 0x00000084,0x0004002b,0x00000006,0x000005a6,0x3f72a76f,0x0004002b,0x00000006,0x000005a7, - 0x3d9e8391,0x0007002c,0x00000018,0x000005a9,0x00000084,0x00000060,0x00000060,0x00000084, - 0x0004002b,0x00000006,0x000005aa,0xbd6147ae,0x00030001,0x00000018,0x000005e3,0x00050036, - 0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,0x00000019, - 0x00000276,0x00000275,0x0004003d,0x00000018,0x00000279,0x00000278,0x00050041,0x0000007a, - 0x000002f9,0x00000077,0x000000e2,0x0004003d,0x00000006,0x000002fa,0x000002f9,0x000500b4, - 0x00000033,0x000002fb,0x000002fa,0x00000060,0x000300f7,0x000003a6,0x00000000,0x000400fa, - 0x000002fb,0x000002fc,0x000002fd,0x000200f8,0x000002fc,0x000200f9,0x000003a6,0x000200f8, - 0x000002fd,0x00050041,0x0000007a,0x000002fe,0x00000077,0x000000e2,0x0004003d,0x00000006, - 0x000002ff,0x000002fe,0x000500b4,0x00000033,0x00000300,0x000002ff,0x00000084,0x000300f7, - 0x000003a5,0x00000000,0x000400fa,0x00000300,0x00000301,0x00000308,0x000200f8,0x00000301, - 0x0004003d,0x000000f0,0x00000302,0x000000f2,0x0004003d,0x000000f4,0x00000303,0x000000f6, - 0x00050056,0x000000f8,0x00000304,0x00000302,0x00000303,0x00050057,0x00000018,0x00000307, - 0x00000304,0x00000276,0x000200f9,0x000003a5,0x000200f8,0x00000308,0x00050041,0x0000007a, - 0x00000309,0x00000077,0x000000e2,0x0004003d,0x00000006,0x0000030a,0x00000309,0x000500b4, - 0x00000033,0x0000030b,0x0000030a,0x00000090,0x000300f7,0x000003a4,0x00000000,0x000400fa, - 0x0000030b,0x0000030c,0x00000338,0x000200f8,0x0000030c,0x0004003d,0x000000f0,0x0000030d, - 0x000000f2,0x0004003d,0x000000f4,0x0000030e,0x000000f6,0x00050056,0x000000f8,0x0000030f, - 0x0000030d,0x0000030e,0x00050057,0x00000018,0x00000312,0x0000030f,0x00000276,0x00050051, - 0x00000006,0x00000313,0x00000312,0x00000000,0x0004003d,0x000000f0,0x00000315,0x0000010d, - 0x0004003d,0x000000f4,0x00000316,0x000000f6,0x00050056,0x000000f8,0x00000317,0x00000315, - 0x00000316,0x00050057,0x00000018,0x0000031a,0x00000317,0x00000276,0x00050051,0x00000006, - 0x0000031d,0x0000031a,0x00000000,0x00050051,0x00000006,0x0000031f,0x0000031a,0x00000001, - 0x00060050,0x0000000f,0x00000598,0x00000313,0x0000031d,0x0000031f,0x00050041,0x0000011a, - 0x00000320,0x00000077,0x00000119,0x0004003d,0x00000018,0x00000321,0x00000320,0x0008004f, - 0x0000000f,0x00000322,0x00000321,0x00000321,0x00000000,0x00000001,0x00000002,0x00050081, - 0x0000000f,0x00000324,0x00000598,0x00000322,0x00050041,0x0000011a,0x00000326,0x00000077, - 0x00000121,0x0004003d,0x00000018,0x00000327,0x00000326,0x0008004f,0x0000000f,0x00000328, - 0x00000327,0x00000327,0x00000000,0x00000001,0x00000002,0x00050094,0x00000006,0x00000329, - 0x00000324,0x00000328,0x00050041,0x0000011a,0x0000032c,0x00000077,0x00000128,0x0004003d, - 0x00000018,0x0000032d,0x0000032c,0x0008004f,0x0000000f,0x0000032e,0x0000032d,0x0000032d, - 0x00000000,0x00000001,0x00000002,0x00050094,0x00000006,0x0000032f,0x00000324,0x0000032e, - 0x00050041,0x0000011a,0x00000332,0x00000077,0x0000012f,0x0004003d,0x00000018,0x00000333, - 0x00000332,0x0008004f,0x0000000f,0x00000334,0x00000333,0x00000333,0x00000000,0x00000001, - 0x00000002,0x00050094,0x00000006,0x00000335,0x00000324,0x00000334,0x00070050,0x00000018, - 0x00000599,0x00000329,0x0000032f,0x00000335,0x00000084,0x000200f9,0x000003a4,0x000200f8, - 0x00000338,0x00050041,0x0000007a,0x00000339,0x00000077,0x000000e2,0x0004003d,0x00000006, - 0x0000033a,0x00000339,0x000500b4,0x00000033,0x0000033b,0x0000033a,0x0000013a,0x000300f7, - 0x000003a3,0x00000000,0x000400fa,0x0000033b,0x0000033c,0x00000368,0x000200f8,0x0000033c, - 0x0004003d,0x000000f0,0x0000033d,0x000000f2,0x0004003d,0x000000f4,0x0000033e,0x000000f6, - 0x00050056,0x000000f8,0x0000033f,0x0000033d,0x0000033e,0x00050057,0x00000018,0x00000342, - 0x0000033f,0x00000276,0x00050051,0x00000006,0x00000343,0x00000342,0x00000000,0x0004003d, - 0x000000f0,0x00000345,0x0000010d,0x0004003d,0x000000f4,0x00000346,0x000000f6,0x00050056, - 0x000000f8,0x00000347,0x00000345,0x00000346,0x00050057,0x00000018,0x0000034a,0x00000347, - 0x00000276,0x00050051,0x00000006,0x0000034d,0x0000034a,0x00000001,0x00050051,0x00000006, - 0x0000034f,0x0000034a,0x00000000,0x00060050,0x0000000f,0x00000596,0x00000343,0x0000034d, - 0x0000034f,0x00050041,0x0000011a,0x00000350,0x00000077,0x00000119,0x0004003d,0x00000018, - 0x00000351,0x00000350,0x0008004f,0x0000000f,0x00000352,0x00000351,0x00000351,0x00000000, - 0x00000001,0x00000002,0x00050081,0x0000000f,0x00000354,0x00000596,0x00000352,0x00050041, - 0x0000011a,0x00000356,0x00000077,0x00000121,0x0004003d,0x00000018,0x00000357,0x00000356, - 0x0008004f,0x0000000f,0x00000358,0x00000357,0x00000357,0x00000000,0x00000001,0x00000002, - 0x00050094,0x00000006,0x00000359,0x00000354,0x00000358,0x00050041,0x0000011a,0x0000035c, - 0x00000077,0x00000128,0x0004003d,0x00000018,0x0000035d,0x0000035c,0x0008004f,0x0000000f, - 0x0000035e,0x0000035d,0x0000035d,0x00000000,0x00000001,0x00000002,0x00050094,0x00000006, - 0x0000035f,0x00000354,0x0000035e,0x00050041,0x0000011a,0x00000362,0x00000077,0x0000012f, - 0x0004003d,0x00000018,0x00000363,0x00000362,0x0008004f,0x0000000f,0x00000364,0x00000363, - 0x00000363,0x00000000,0x00000001,0x00000002,0x00050094,0x00000006,0x00000365,0x00000354, - 0x00000364,0x00070050,0x00000018,0x00000597,0x00000359,0x0000035f,0x00000365,0x00000084, - 0x000200f9,0x000003a3,0x000200f8,0x00000368,0x00050041,0x0000007a,0x00000369,0x00000077, - 0x000000e2,0x0004003d,0x00000006,0x0000036a,0x00000369,0x000500b4,0x00000033,0x0000036b, - 0x0000036a,0x0000016d,0x000300f7,0x000003a2,0x00000000,0x000400fa,0x0000036b,0x0000036c, - 0x0000039d,0x000200f8,0x0000036c,0x0004003d,0x000000f0,0x0000036d,0x000000f2,0x0004003d, - 0x000000f4,0x0000036e,0x000000f6,0x00050056,0x000000f8,0x0000036f,0x0000036d,0x0000036e, - 0x00050057,0x00000018,0x00000372,0x0000036f,0x00000276,0x00050051,0x00000006,0x00000373, - 0x00000372,0x00000000,0x0004003d,0x000000f0,0x00000375,0x0000010d,0x0004003d,0x000000f4, - 0x00000376,0x000000f6,0x00050056,0x000000f8,0x00000377,0x00000375,0x00000376,0x00050057, - 0x00000018,0x0000037a,0x00000377,0x00000276,0x00050051,0x00000006,0x0000037b,0x0000037a, - 0x00000000,0x0004003d,0x000000f0,0x0000037d,0x00000182,0x0004003d,0x000000f4,0x0000037e, - 0x000000f6,0x00050056,0x000000f8,0x0000037f,0x0000037d,0x0000037e,0x00050057,0x00000018, - 0x00000382,0x0000037f,0x00000276,0x00050051,0x00000006,0x00000383,0x00000382,0x00000000, - 0x00060050,0x0000000f,0x00000594,0x00000373,0x0000037b,0x00000383,0x00050041,0x0000011a, - 0x00000385,0x00000077,0x00000119,0x0004003d,0x00000018,0x00000386,0x00000385,0x0008004f, - 0x0000000f,0x00000387,0x00000386,0x00000386,0x00000000,0x00000001,0x00000002,0x00050081, - 0x0000000f,0x00000389,0x00000594,0x00000387,0x00050041,0x0000011a,0x0000038b,0x00000077, - 0x00000121,0x0004003d,0x00000018,0x0000038c,0x0000038b,0x0008004f,0x0000000f,0x0000038d, - 0x0000038c,0x0000038c,0x00000000,0x00000001,0x00000002,0x00050094,0x00000006,0x0000038e, - 0x00000389,0x0000038d,0x00050041,0x0000011a,0x00000391,0x00000077,0x00000128,0x0004003d, - 0x00000018,0x00000392,0x00000391,0x0008004f,0x0000000f,0x00000393,0x00000392,0x00000392, - 0x00000000,0x00000001,0x00000002,0x00050094,0x00000006,0x00000394,0x00000389,0x00000393, - 0x00050041,0x0000011a,0x00000397,0x00000077,0x0000012f,0x0004003d,0x00000018,0x00000398, - 0x00000397,0x0008004f,0x0000000f,0x00000399,0x00000398,0x00000398,0x00000000,0x00000001, - 0x00000002,0x00050094,0x00000006,0x0000039a,0x00000389,0x00000399,0x00070050,0x00000018, - 0x00000595,0x0000038e,0x00000394,0x0000039a,0x00000084,0x000200f9,0x000003a2,0x000200f8, - 0x0000039d,0x000200f9,0x000003a2,0x000200f8,0x000003a2,0x000700f5,0x00000018,0x000005af, - 0x00000595,0x0000036c,0x000005a9,0x0000039d,0x000200f9,0x000003a3,0x000200f8,0x000003a3, - 0x000700f5,0x00000018,0x000005ae,0x00000597,0x0000033c,0x000005af,0x000003a2,0x000200f9, - 0x000003a4,0x000200f8,0x000003a4,0x000700f5,0x00000018,0x000005ad,0x00000599,0x0000030c, - 0x000005ae,0x000003a3,0x000200f9,0x000003a5,0x000200f8,0x000003a5,0x000700f5,0x00000018, - 0x000005ac,0x00000307,0x00000301,0x000005ad,0x000003a4,0x000200f9,0x000003a6,0x000200f8, - 0x000003a6,0x000700f5,0x00000018,0x000005ab,0x000000e9,0x000002fc,0x000005ac,0x000003a5, - 0x00050041,0x0000007a,0x00000292,0x00000077,0x00000094,0x0004003d,0x00000006,0x00000293, - 0x00000292,0x000500b4,0x00000033,0x00000294,0x00000293,0x0000013a,0x000300f7,0x0000029f, - 0x00000000,0x000400fa,0x00000294,0x00000295,0x0000029f,0x000200f8,0x00000295,0x0008004f, - 0x0000000f,0x00000297,0x000005ab,0x000005ab,0x00000000,0x00000001,0x00000002,0x0006000c, - 0x0000000f,0x000003ad,0x00000001,0x00000004,0x00000297,0x0007000c,0x0000000f,0x000003ae, - 0x00000001,0x0000001a,0x000003ad,0x0000005b,0x00050083,0x0000000f,0x000003b0,0x000003ae, - 0x0000059a,0x0007000c,0x0000000f,0x000003b1,0x00000001,0x00000028,0x000003b0,0x00000061, - 0x0006000c,0x0000000f,0x000003b3,0x00000001,0x00000004,0x00000297,0x0007000c,0x0000000f, - 0x000003b4,0x00000001,0x0000001a,0x000003b3,0x0000005b,0x0005008e,0x0000000f,0x000003b5, - 0x000003b4,0x00000065,0x00050083,0x0000000f,0x000003b7,0x0000059b,0x000003b5,0x00050088, - 0x0000000f,0x000003ba,0x000003b1,0x000003b7,0x0006000c,0x0000000f,0x000003bb,0x00000001, - 0x00000004,0x000003ba,0x0007000c,0x0000000f,0x000003bc,0x00000001,0x0000001a,0x000003bb, - 0x00000072,0x0005008e,0x0000000f,0x000003bd,0x000003bc,0x0000006c,0x00050041,0x0000007a, - 0x000003be,0x00000077,0x00000079,0x0004003d,0x00000006,0x000003bf,0x000003be,0x00060050, - 0x0000000f,0x000003c0,0x000003bf,0x000003bf,0x000003bf,0x00050088,0x0000000f,0x000003c1, - 0x000003bd,0x000003c0,0x00050051,0x00000006,0x0000029a,0x000003c1,0x00000000,0x00060052, - 0x00000018,0x00000540,0x0000029a,0x000005ab,0x00000000,0x00050051,0x00000006,0x0000029c, - 0x000003c1,0x00000001,0x00060052,0x00000018,0x00000542,0x0000029c,0x00000540,0x00000001, - 0x00050051,0x00000006,0x0000029e,0x000003c1,0x00000002,0x00060052,0x00000018,0x00000544, - 0x0000029e,0x00000542,0x00000002,0x000200f9,0x0000029f,0x000200f8,0x0000029f,0x000700f5, - 0x00000018,0x000005b0,0x000005ab,0x000003a6,0x00000544,0x00000295,0x00050041,0x0000007a, - 0x000002a0,0x00000077,0x00000081,0x0004003d,0x00000006,0x000002a1,0x000002a0,0x000500b7, - 0x00000033,0x000002a2,0x000002a1,0x00000060,0x000300f7,0x000002ad,0x00000000,0x000400fa, - 0x000002a2,0x000002a3,0x000002ad,0x000200f8,0x000002a3,0x0008004f,0x0000000f,0x000002a5, - 0x000005b0,0x000005b0,0x00000000,0x00000001,0x00000002,0x00050041,0x0000007a,0x000003c6, - 0x00000077,0x00000081,0x0004003d,0x00000006,0x000003c7,0x000003c6,0x000500b4,0x00000033, - 0x000003c8,0x000003c7,0x00000084,0x000300f7,0x000003fc,0x00000000,0x000400fa,0x000003c8, - 0x000003c9,0x000003ce,0x000200f8,0x000003c9,0x00050041,0x0000007a,0x000003ca,0x00000077, - 0x00000088,0x0004003d,0x00000006,0x000003cb,0x000003ca,0x0005008e,0x0000000f,0x000003cd, - 0x000002a5,0x000003cb,0x000200f9,0x000003fc,0x000200f8,0x000003ce,0x00050041,0x0000007a, - 0x000003cf,0x00000077,0x00000081,0x0004003d,0x00000006,0x000003d0,0x000003cf,0x000500b4, - 0x00000033,0x000003d1,0x000003d0,0x00000090,0x000300f7,0x000003fb,0x00000000,0x000400fa, - 0x000003d1,0x000003d2,0x000003fb,0x000200f8,0x000003d2,0x00050041,0x0000007a,0x000003d3, - 0x00000077,0x00000094,0x0004003d,0x00000006,0x000003d4,0x000003d3,0x000500b4,0x00000033, - 0x000003d5,0x000003d4,0x00000090,0x000300f7,0x000003d9,0x00000000,0x000400fa,0x000003d5, - 0x000003d6,0x000003d9,0x000200f8,0x000003d6,0x00050090,0x0000000f,0x000003d8,0x000002a5, - 0x000000a8,0x000200f9,0x000003d9,0x000200f8,0x000003d9,0x000700f5,0x0000000f,0x000005b1, - 0x000002a5,0x000003d2,0x000003d8,0x000003d6,0x00050051,0x00000006,0x000003db,0x000005b1, - 0x00000000,0x00050051,0x00000006,0x000003dd,0x000005b1,0x00000001,0x00050051,0x00000006, - 0x000003df,0x000005b1,0x00000002,0x0007000c,0x00000006,0x000003e0,0x00000001,0x00000028, - 0x000003dd,0x000003df,0x0007000c,0x00000006,0x000003e1,0x00000001,0x00000028,0x000003db, - 0x000003e0,0x000500ba,0x00000033,0x000003e3,0x000003e1,0x00000060,0x000300f7,0x000003f3, - 0x00000000,0x000400fa,0x000003e3,0x000003e4,0x000003f3,0x000200f8,0x000003e4,0x00050041, - 0x0000007a,0x000003e5,0x00000077,0x00000088,0x0004003d,0x00000006,0x000003e6,0x000003e5, - 0x0008000c,0x00000006,0x000003e9,0x00000001,0x00000032,0x000003e6,0x000003e1,0x00000084, - 0x00050041,0x0000007a,0x000003ea,0x00000077,0x000000c1,0x0004003d,0x00000006,0x000003eb, - 0x000003ea,0x0008000c,0x00000006,0x000003ee,0x00000001,0x00000032,0x000003eb,0x000003e1, - 0x00000084,0x00050088,0x00000006,0x000003ef,0x000003e9,0x000003ee,0x0005008e,0x0000000f, - 0x000003f2,0x000005b1,0x000003ef,0x000200f9,0x000003f3,0x000200f8,0x000003f3,0x000700f5, - 0x0000000f,0x000005b2,0x000005b1,0x000003d9,0x000003f2,0x000003e4,0x00050041,0x0000007a, - 0x000003f4,0x00000077,0x00000094,0x0004003d,0x00000006,0x000003f5,0x000003f4,0x000500b4, - 0x00000033,0x000003f6,0x000003f5,0x00000090,0x000300f7,0x000003fa,0x00000000,0x000400fa, - 0x000003f6,0x000003f7,0x000003fa,0x000200f8,0x000003f7,0x00050090,0x0000000f,0x000003f9, - 0x000005b2,0x000000dd,0x000200f9,0x000003fa,0x000200f8,0x000003fa,0x000700f5,0x0000000f, - 0x000005b5,0x000005b2,0x000003f3,0x000003f9,0x000003f7,0x000200f9,0x000003fb,0x000200f8, - 0x000003fb,0x000700f5,0x0000000f,0x000005b4,0x000002a5,0x000003ce,0x000005b5,0x000003fa, - 0x000200f9,0x000003fc,0x000200f8,0x000003fc,0x000700f5,0x0000000f,0x000005b3,0x000003cd, - 0x000003c9,0x000005b4,0x000003fb,0x00050051,0x00000006,0x000002a8,0x000005b3,0x00000000, - 0x00060052,0x00000018,0x00000549,0x000002a8,0x000005b0,0x00000000,0x00050051,0x00000006, - 0x000002aa,0x000005b3,0x00000001,0x00060052,0x00000018,0x0000054b,0x000002aa,0x00000549, - 0x00000001,0x00050051,0x00000006,0x000002ac,0x000005b3,0x00000002,0x00060052,0x00000018, - 0x0000054d,0x000002ac,0x0000054b,0x00000002,0x000200f9,0x000002ad,0x000200f8,0x000002ad, - 0x000700f5,0x00000018,0x000005bb,0x000005b0,0x0000029f,0x0000054d,0x000003fc,0x00050041, - 0x0000007a,0x000002ae,0x00000077,0x00000094,0x0004003d,0x00000006,0x000002af,0x000002ae, - 0x000500b4,0x00000033,0x000002b0,0x000002af,0x00000084,0x000300f7,0x000002ee,0x00000000, - 0x000400fa,0x000002b0,0x000002b1,0x000002be,0x000200f8,0x000002b1,0x0008004f,0x0000000f, - 0x000002b3,0x000005bb,0x000005bb,0x00000000,0x00000001,0x00000002,0x00050041,0x0000007a, - 0x00000404,0x00000077,0x000001be,0x0004003d,0x00000006,0x00000405,0x00000404,0x000500b7, - 0x00000033,0x00000406,0x00000405,0x00000060,0x000300f7,0x00000414,0x00000000,0x000400fa, - 0x00000406,0x00000407,0x00000414,0x000200f8,0x00000407,0x00050051,0x00000006,0x00000409, - 0x000005bb,0x00000000,0x000500bc,0x00000033,0x0000041d,0x00000409,0x00000032,0x000300f7, - 0x00000427,0x00000000,0x000400fa,0x0000041d,0x0000041e,0x00000421,0x000200f8,0x0000041e, - 0x00050085,0x00000006,0x00000420,0x00000409,0x000005a7,0x000200f9,0x00000427,0x000200f8, - 0x00000421,0x00050081,0x00000006,0x00000423,0x00000409,0x0000003c,0x0006000c,0x00000006, - 0x00000424,0x00000001,0x00000004,0x00000423,0x00050085,0x00000006,0x00000425,0x00000424, - 0x000005a6,0x0007000c,0x00000006,0x00000426,0x00000001,0x0000001a,0x00000425,0x00000041, - 0x000200f9,0x00000427,0x000200f8,0x00000427,0x000700f5,0x00000006,0x000005d2,0x00000420, - 0x0000041e,0x00000426,0x00000421,0x00050051,0x00000006,0x0000040d,0x000005bb,0x00000001, - 0x000500bc,0x00000033,0x0000042c,0x0000040d,0x00000032,0x000300f7,0x00000436,0x00000000, - 0x000400fa,0x0000042c,0x0000042d,0x00000430,0x000200f8,0x0000042d,0x00050085,0x00000006, - 0x0000042f,0x0000040d,0x000005a7,0x000200f9,0x00000436,0x000200f8,0x00000430,0x00050081, - 0x00000006,0x00000432,0x0000040d,0x0000003c,0x0006000c,0x00000006,0x00000433,0x00000001, - 0x00000004,0x00000432,0x00050085,0x00000006,0x00000434,0x00000433,0x000005a6,0x0007000c, - 0x00000006,0x00000435,0x00000001,0x0000001a,0x00000434,0x00000041,0x000200f9,0x00000436, - 0x000200f8,0x00000436,0x000700f5,0x00000006,0x000005d4,0x0000042f,0x0000042d,0x00000435, - 0x00000430,0x00050051,0x00000006,0x00000411,0x000005bb,0x00000002,0x000500bc,0x00000033, - 0x0000043b,0x00000411,0x00000032,0x000300f7,0x00000445,0x00000000,0x000400fa,0x0000043b, - 0x0000043c,0x0000043f,0x000200f8,0x0000043c,0x00050085,0x00000006,0x0000043e,0x00000411, - 0x000005a7,0x000200f9,0x00000445,0x000200f8,0x0000043f,0x00050081,0x00000006,0x00000441, - 0x00000411,0x0000003c,0x0006000c,0x00000006,0x00000442,0x00000001,0x00000004,0x00000441, - 0x00050085,0x00000006,0x00000443,0x00000442,0x000005a6,0x0007000c,0x00000006,0x00000444, - 0x00000001,0x0000001a,0x00000443,0x00000041,0x000200f9,0x00000445,0x000200f8,0x00000445, - 0x000700f5,0x00000006,0x000005d6,0x0000043e,0x0000043c,0x00000444,0x0000043f,0x00060050, - 0x0000000f,0x000005e2,0x000005d2,0x000005d4,0x000005d6,0x000200f9,0x00000414,0x000200f8, - 0x00000414,0x000700f5,0x0000000f,0x000005d8,0x000002b3,0x000002b1,0x000005e2,0x00000445, - 0x00050041,0x0000007a,0x00000416,0x00000077,0x000001ae,0x0004003d,0x00000006,0x00000417, - 0x00000416,0x0005008e,0x0000000f,0x00000418,0x000005d8,0x00000417,0x00050051,0x00000006, - 0x000002b6,0x00000418,0x00000000,0x00050051,0x00000006,0x000002b8,0x00000418,0x00000001, - 0x00050051,0x00000006,0x000002ba,0x00000418,0x00000002,0x00050051,0x00000006,0x000002bc, - 0x000005bb,0x00000003,0x00070050,0x00000018,0x000005a8,0x000002b6,0x000002b8,0x000002ba, - 0x000002bc,0x000200f9,0x000002ee,0x000200f8,0x000002be,0x00050041,0x0000007a,0x000002bf, - 0x00000077,0x00000094,0x0004003d,0x00000006,0x000002c0,0x000002bf,0x000500b4,0x00000033, - 0x000002c1,0x000002c0,0x00000090,0x000300f7,0x000002ed,0x00000000,0x000400fa,0x000002c1, - 0x000002c2,0x000002cf,0x000200f8,0x000002c2,0x0008004f,0x0000000f,0x000002c4,0x000005bb, - 0x000005bb,0x00000000,0x00000001,0x00000002,0x00050041,0x0000007a,0x0000044e,0x00000077, - 0x000001ae,0x0004003d,0x00000006,0x0000044f,0x0000044e,0x0005008e,0x0000000f,0x00000450, - 0x000002c4,0x0000044f,0x00050041,0x0000007a,0x00000451,0x00000077,0x000001be,0x0004003d, - 0x00000006,0x00000452,0x00000451,0x000500b7,0x00000033,0x00000453,0x00000452,0x00000060, - 0x000400a8,0x00000033,0x00000454,0x00000453,0x000300f7,0x00000466,0x00000000,0x000400fa, - 0x00000454,0x00000455,0x00000466,0x000200f8,0x00000455,0x00050051,0x00000006,0x00000457, - 0x00000450,0x00000000,0x000500bc,0x00000033,0x0000046b,0x00000457,0x00000047,0x000300f7, - 0x00000475,0x00000000,0x000400fa,0x0000046b,0x0000046c,0x0000046f,0x000200f8,0x0000046c, - 0x00050085,0x00000006,0x0000046e,0x00000457,0x00000038,0x000200f9,0x00000475,0x000200f8, - 0x0000046f,0x0006000c,0x00000006,0x00000471,0x00000001,0x00000004,0x00000457,0x0007000c, - 0x00000006,0x00000472,0x00000001,0x0000001a,0x00000471,0x00000050,0x0008000c,0x00000006, - 0x00000474,0x00000001,0x00000032,0x00000472,0x0000003f,0x000005aa,0x000200f9,0x00000475, - 0x000200f8,0x00000475,0x000700f5,0x00000006,0x000005c7,0x0000046e,0x0000046c,0x00000474, - 0x0000046f,0x00050051,0x00000006,0x0000045b,0x00000450,0x00000001,0x000500bc,0x00000033, - 0x0000047a,0x0000045b,0x00000047,0x000300f7,0x00000484,0x00000000,0x000400fa,0x0000047a, - 0x0000047b,0x0000047e,0x000200f8,0x0000047b,0x00050085,0x00000006,0x0000047d,0x0000045b, - 0x00000038,0x000200f9,0x00000484,0x000200f8,0x0000047e,0x0006000c,0x00000006,0x00000480, - 0x00000001,0x00000004,0x0000045b,0x0007000c,0x00000006,0x00000481,0x00000001,0x0000001a, - 0x00000480,0x00000050,0x0008000c,0x00000006,0x00000483,0x00000001,0x00000032,0x00000481, - 0x0000003f,0x000005aa,0x000200f9,0x00000484,0x000200f8,0x00000484,0x000700f5,0x00000006, - 0x000005c9,0x0000047d,0x0000047b,0x00000483,0x0000047e,0x00050051,0x00000006,0x0000045f, - 0x00000450,0x00000002,0x000500bc,0x00000033,0x00000489,0x0000045f,0x00000047,0x000300f7, - 0x00000493,0x00000000,0x000400fa,0x00000489,0x0000048a,0x0000048d,0x000200f8,0x0000048a, - 0x00050085,0x00000006,0x0000048c,0x0000045f,0x00000038,0x000200f9,0x00000493,0x000200f8, - 0x0000048d,0x0006000c,0x00000006,0x0000048f,0x00000001,0x00000004,0x0000045f,0x0007000c, - 0x00000006,0x00000490,0x00000001,0x0000001a,0x0000048f,0x00000050,0x0008000c,0x00000006, - 0x00000492,0x00000001,0x00000032,0x00000490,0x0000003f,0x000005aa,0x000200f9,0x00000493, - 0x000200f8,0x00000493,0x000700f5,0x00000006,0x000005cb,0x0000048c,0x0000048a,0x00000492, - 0x0000048d,0x00060050,0x0000000f,0x000005e1,0x000005c7,0x000005c9,0x000005cb,0x0008000c, - 0x0000000f,0x00000465,0x00000001,0x0000002b,0x000005e1,0x00000061,0x000005a0,0x000200f9, - 0x00000466,0x000200f8,0x00000466,0x000700f5,0x0000000f,0x000005cd,0x00000450,0x000002c2, - 0x00000465,0x00000493,0x00050051,0x00000006,0x000002c7,0x000005cd,0x00000000,0x00050051, - 0x00000006,0x000002c9,0x000005cd,0x00000001,0x00050051,0x00000006,0x000002cb,0x000005cd, - 0x00000002,0x00050051,0x00000006,0x000002cd,0x000005bb,0x00000003,0x00070050,0x00000018, - 0x000005a5,0x000002c7,0x000002c9,0x000002cb,0x000002cd,0x000200f9,0x000002ed,0x000200f8, - 0x000002cf,0x00050041,0x0000007a,0x000002d0,0x00000077,0x00000094,0x0004003d,0x00000006, - 0x000002d1,0x000002d0,0x000500b4,0x00000033,0x000002d2,0x000002d1,0x0000013a,0x000300f7, - 0x000002ec,0x00000000,0x000400fa,0x000002d2,0x000002d3,0x000002e9,0x000200f8,0x000002d3, - 0x0008004f,0x0000000f,0x000002d5,0x000005bb,0x000005bb,0x00000000,0x00000001,0x00000002, - 0x00050090,0x0000000f,0x000002d6,0x000002d5,0x000000dd,0x00050051,0x00000006,0x000002d8, - 0x000002d6,0x00000000,0x00060052,0x00000018,0x00000573,0x000002d8,0x000005e3,0x00000000, - 0x00050051,0x00000006,0x000002da,0x000002d6,0x00000001,0x00060052,0x00000018,0x00000575, - 0x000002da,0x00000573,0x00000001,0x00050051,0x00000006,0x000002dc,0x000002d6,0x00000002, - 0x00060052,0x00000018,0x00000577,0x000002dc,0x00000575,0x00000002,0x0008004f,0x0000000f, - 0x000002de,0x00000577,0x00000577,0x00000000,0x00000001,0x00000002,0x00050041,0x0000007a, - 0x0000049c,0x00000077,0x000001ae,0x0004003d,0x00000006,0x0000049d,0x0000049c,0x0005008e, - 0x0000000f,0x0000049e,0x000002de,0x0000049d,0x00050041,0x0000007a,0x0000049f,0x00000077, - 0x000001be,0x0004003d,0x00000006,0x000004a0,0x0000049f,0x000500b7,0x00000033,0x000004a1, - 0x000004a0,0x00000060,0x000400a8,0x00000033,0x000004a2,0x000004a1,0x000300f7,0x000004b4, - 0x00000000,0x000400fa,0x000004a2,0x000004a3,0x000004b4,0x000200f8,0x000004a3,0x00050051, - 0x00000006,0x000004a5,0x0000049e,0x00000000,0x000500bc,0x00000033,0x000004b9,0x000004a5, - 0x00000047,0x000300f7,0x000004c3,0x00000000,0x000400fa,0x000004b9,0x000004ba,0x000004bd, - 0x000200f8,0x000004ba,0x00050085,0x00000006,0x000004bc,0x000004a5,0x00000038,0x000200f9, - 0x000004c3,0x000200f8,0x000004bd,0x0006000c,0x00000006,0x000004bf,0x00000001,0x00000004, - 0x000004a5,0x0007000c,0x00000006,0x000004c0,0x00000001,0x0000001a,0x000004bf,0x00000050, - 0x0008000c,0x00000006,0x000004c2,0x00000001,0x00000032,0x000004c0,0x0000003f,0x000005aa, - 0x000200f9,0x000004c3,0x000200f8,0x000004c3,0x000700f5,0x00000006,0x000005bc,0x000004bc, - 0x000004ba,0x000004c2,0x000004bd,0x00050051,0x00000006,0x000004a9,0x0000049e,0x00000001, - 0x000500bc,0x00000033,0x000004c8,0x000004a9,0x00000047,0x000300f7,0x000004d2,0x00000000, - 0x000400fa,0x000004c8,0x000004c9,0x000004cc,0x000200f8,0x000004c9,0x00050085,0x00000006, - 0x000004cb,0x000004a9,0x00000038,0x000200f9,0x000004d2,0x000200f8,0x000004cc,0x0006000c, - 0x00000006,0x000004ce,0x00000001,0x00000004,0x000004a9,0x0007000c,0x00000006,0x000004cf, - 0x00000001,0x0000001a,0x000004ce,0x00000050,0x0008000c,0x00000006,0x000004d1,0x00000001, - 0x00000032,0x000004cf,0x0000003f,0x000005aa,0x000200f9,0x000004d2,0x000200f8,0x000004d2, - 0x000700f5,0x00000006,0x000005be,0x000004cb,0x000004c9,0x000004d1,0x000004cc,0x00050051, - 0x00000006,0x000004ad,0x0000049e,0x00000002,0x000500bc,0x00000033,0x000004d7,0x000004ad, - 0x00000047,0x000300f7,0x000004e1,0x00000000,0x000400fa,0x000004d7,0x000004d8,0x000004db, - 0x000200f8,0x000004d8,0x00050085,0x00000006,0x000004da,0x000004ad,0x00000038,0x000200f9, - 0x000004e1,0x000200f8,0x000004db,0x0006000c,0x00000006,0x000004dd,0x00000001,0x00000004, - 0x000004ad,0x0007000c,0x00000006,0x000004de,0x00000001,0x0000001a,0x000004dd,0x00000050, - 0x0008000c,0x00000006,0x000004e0,0x00000001,0x00000032,0x000004de,0x0000003f,0x000005aa, - 0x000200f9,0x000004e1,0x000200f8,0x000004e1,0x000700f5,0x00000006,0x000005c0,0x000004da, - 0x000004d8,0x000004e0,0x000004db,0x00060050,0x0000000f,0x000005e0,0x000005bc,0x000005be, - 0x000005c0,0x0008000c,0x0000000f,0x000004b3,0x00000001,0x0000002b,0x000005e0,0x00000061, - 0x000005a0,0x000200f9,0x000004b4,0x000200f8,0x000004b4,0x000700f5,0x0000000f,0x000005c2, - 0x0000049e,0x000002d3,0x000004b3,0x000004e1,0x00050051,0x00000006,0x000002e1,0x000005c2, - 0x00000000,0x00050051,0x00000006,0x000002e3,0x000005c2,0x00000001,0x00050051,0x00000006, - 0x000002e5,0x000005c2,0x00000002,0x00050051,0x00000006,0x000002e7,0x000005bb,0x00000003, - 0x00070050,0x00000018,0x000005a1,0x000002e1,0x000002e3,0x000002e5,0x000002e7,0x000200f9, - 0x000002ec,0x000200f8,0x000002e9,0x0008004f,0x0000000f,0x000004e7,0x000005bb,0x000005bb, - 0x00000000,0x00000001,0x00000002,0x00050041,0x0000007a,0x000004e8,0x00000077,0x000001ae, - 0x0004003d,0x00000006,0x000004e9,0x000004e8,0x0005008e,0x0000000f,0x000004ea,0x000004e7, - 0x000004e9,0x00050051,0x00000006,0x000004ec,0x000004ea,0x00000000,0x00050051,0x00000006, - 0x000004ee,0x000004ea,0x00000001,0x00050051,0x00000006,0x000004f0,0x000004ea,0x00000002, - 0x00050051,0x00000006,0x000004f2,0x000005bb,0x00000003,0x00070050,0x00000018,0x0000059c, - 0x000004ec,0x000004ee,0x000004f0,0x000004f2,0x000200f9,0x000002ec,0x000200f8,0x000002ec, - 0x000700f5,0x00000018,0x000005df,0x000005a1,0x000004b4,0x0000059c,0x000002e9,0x000200f9, - 0x000002ed,0x000200f8,0x000002ed,0x000700f5,0x00000018,0x000005de,0x000005a5,0x00000466, - 0x000005df,0x000002ec,0x000200f9,0x000002ee,0x000200f8,0x000002ee,0x000700f5,0x00000018, - 0x000005dd,0x000005a8,0x00000414,0x000005de,0x000002ed,0x00050085,0x00000018,0x000002f2, - 0x000005dd,0x00000279,0x0003003e,0x0000027c,0x000002f2,0x000100fd,0x00010038 + 0x000000d8,0x000000dc,0x00090019,0x000000e3,0x00000006,0x00000001,0x00000000,0x00000000, + 0x00000000,0x00000001,0x00000000,0x0003001b,0x000000e4,0x000000e3,0x00040020,0x000000e5, + 0x00000000,0x000000e4,0x0004003b,0x000000e5,0x000000e6,0x00000000,0x0004002b,0x00000078, + 0x000000f2,0x00000002,0x0004002b,0x00000078,0x00000103,0x00000000,0x0004002b,0x00000006, + 0x00000147,0x40400000,0x00040020,0x000001b6,0x00000001,0x00000018,0x00040020,0x000001ba, + 0x00000001,0x00000019,0x0004003b,0x000001ba,0x000001bb,0x00000001,0x0004003b,0x000001b6, + 0x000001be,0x00000001,0x00040020,0x000001c1,0x00000003,0x00000018,0x0004003b,0x000001c1, + 0x000001c2,0x00000003,0x0006002c,0x0000000f,0x000003fa,0x0000005d,0x0000005d,0x0000005d, + 0x0006002c,0x0000000f,0x000003fb,0x00000064,0x00000064,0x00000064,0x0006002c,0x0000000f, + 0x00000400,0x00000084,0x00000084,0x00000084,0x0004002b,0x00000006,0x00000406,0x3f72a76f, + 0x0004002b,0x00000006,0x00000407,0x3d9e8391,0x0004002b,0x00000006,0x00000409,0xbd6147ae, + 0x00030001,0x00000018,0x0000043d,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003, + 0x000200f8,0x00000005,0x0004003d,0x00000019,0x000001bc,0x000001bb,0x0004003d,0x00000018, + 0x000001bf,0x000001be,0x0004003d,0x000000e4,0x0000023c,0x000000e6,0x00050057,0x00000018, + 0x0000023f,0x0000023c,0x000001bc,0x00050041,0x0000007a,0x000001d8,0x00000077,0x00000094, + 0x0004003d,0x00000006,0x000001d9,0x000001d8,0x000500b4,0x00000033,0x000001da,0x000001d9, + 0x00000147,0x000300f7,0x000001e5,0x00000000,0x000400fa,0x000001da,0x000001db,0x000001e5, + 0x000200f8,0x000001db,0x0008004f,0x0000000f,0x000001dd,0x0000023f,0x0000023f,0x00000000, + 0x00000001,0x00000002,0x0006000c,0x0000000f,0x00000246,0x00000001,0x00000004,0x000001dd, + 0x0007000c,0x0000000f,0x00000247,0x00000001,0x0000001a,0x00000246,0x0000005b,0x00050083, + 0x0000000f,0x00000249,0x00000247,0x000003fa,0x0007000c,0x0000000f,0x0000024a,0x00000001, + 0x00000028,0x00000249,0x00000061,0x0006000c,0x0000000f,0x0000024c,0x00000001,0x00000004, + 0x000001dd,0x0007000c,0x0000000f,0x0000024d,0x00000001,0x0000001a,0x0000024c,0x0000005b, + 0x0005008e,0x0000000f,0x0000024e,0x0000024d,0x00000065,0x00050083,0x0000000f,0x00000250, + 0x000003fb,0x0000024e,0x00050088,0x0000000f,0x00000253,0x0000024a,0x00000250,0x0006000c, + 0x0000000f,0x00000254,0x00000001,0x00000004,0x00000253,0x0007000c,0x0000000f,0x00000255, + 0x00000001,0x0000001a,0x00000254,0x00000072,0x0005008e,0x0000000f,0x00000256,0x00000255, + 0x0000006c,0x00050041,0x0000007a,0x00000257,0x00000077,0x00000079,0x0004003d,0x00000006, + 0x00000258,0x00000257,0x00060050,0x0000000f,0x00000259,0x00000258,0x00000258,0x00000258, + 0x00050088,0x0000000f,0x0000025a,0x00000256,0x00000259,0x00050051,0x00000006,0x000001e0, + 0x0000025a,0x00000000,0x00060052,0x00000018,0x000003a7,0x000001e0,0x0000023f,0x00000000, + 0x00050051,0x00000006,0x000001e2,0x0000025a,0x00000001,0x00060052,0x00000018,0x000003a9, + 0x000001e2,0x000003a7,0x00000001,0x00050051,0x00000006,0x000001e4,0x0000025a,0x00000002, + 0x00060052,0x00000018,0x000003ab,0x000001e4,0x000003a9,0x00000002,0x000200f9,0x000001e5, + 0x000200f8,0x000001e5,0x000700f5,0x00000018,0x0000040a,0x0000023f,0x00000005,0x000003ab, + 0x000001db,0x00050041,0x0000007a,0x000001e6,0x00000077,0x00000081,0x0004003d,0x00000006, + 0x000001e7,0x000001e6,0x000500b7,0x00000033,0x000001e8,0x000001e7,0x00000060,0x000300f7, + 0x000001f3,0x00000000,0x000400fa,0x000001e8,0x000001e9,0x000001f3,0x000200f8,0x000001e9, + 0x0008004f,0x0000000f,0x000001eb,0x0000040a,0x0000040a,0x00000000,0x00000001,0x00000002, + 0x00050041,0x0000007a,0x0000025f,0x00000077,0x00000081,0x0004003d,0x00000006,0x00000260, + 0x0000025f,0x000500b4,0x00000033,0x00000261,0x00000260,0x00000084,0x000300f7,0x00000295, + 0x00000000,0x000400fa,0x00000261,0x00000262,0x00000267,0x000200f8,0x00000262,0x00050041, + 0x0000007a,0x00000263,0x00000077,0x00000088,0x0004003d,0x00000006,0x00000264,0x00000263, + 0x0005008e,0x0000000f,0x00000266,0x000001eb,0x00000264,0x000200f9,0x00000295,0x000200f8, + 0x00000267,0x00050041,0x0000007a,0x00000268,0x00000077,0x00000081,0x0004003d,0x00000006, + 0x00000269,0x00000268,0x000500b4,0x00000033,0x0000026a,0x00000269,0x00000090,0x000300f7, + 0x00000294,0x00000000,0x000400fa,0x0000026a,0x0000026b,0x00000294,0x000200f8,0x0000026b, + 0x00050041,0x0000007a,0x0000026c,0x00000077,0x00000094,0x0004003d,0x00000006,0x0000026d, + 0x0000026c,0x000500b4,0x00000033,0x0000026e,0x0000026d,0x00000090,0x000300f7,0x00000272, + 0x00000000,0x000400fa,0x0000026e,0x0000026f,0x00000272,0x000200f8,0x0000026f,0x00050090, + 0x0000000f,0x00000271,0x000001eb,0x000000a8,0x000200f9,0x00000272,0x000200f8,0x00000272, + 0x000700f5,0x0000000f,0x0000040b,0x000001eb,0x0000026b,0x00000271,0x0000026f,0x00050051, + 0x00000006,0x00000274,0x0000040b,0x00000000,0x00050051,0x00000006,0x00000276,0x0000040b, + 0x00000001,0x00050051,0x00000006,0x00000278,0x0000040b,0x00000002,0x0007000c,0x00000006, + 0x00000279,0x00000001,0x00000028,0x00000276,0x00000278,0x0007000c,0x00000006,0x0000027a, + 0x00000001,0x00000028,0x00000274,0x00000279,0x000500ba,0x00000033,0x0000027c,0x0000027a, + 0x00000060,0x000300f7,0x0000028c,0x00000000,0x000400fa,0x0000027c,0x0000027d,0x0000028c, + 0x000200f8,0x0000027d,0x00050041,0x0000007a,0x0000027e,0x00000077,0x00000088,0x0004003d, + 0x00000006,0x0000027f,0x0000027e,0x0008000c,0x00000006,0x00000282,0x00000001,0x00000032, + 0x0000027f,0x0000027a,0x00000084,0x00050041,0x0000007a,0x00000283,0x00000077,0x000000c1, + 0x0004003d,0x00000006,0x00000284,0x00000283,0x0008000c,0x00000006,0x00000287,0x00000001, + 0x00000032,0x00000284,0x0000027a,0x00000084,0x00050088,0x00000006,0x00000288,0x00000282, + 0x00000287,0x0005008e,0x0000000f,0x0000028b,0x0000040b,0x00000288,0x000200f9,0x0000028c, + 0x000200f8,0x0000028c,0x000700f5,0x0000000f,0x0000040c,0x0000040b,0x00000272,0x0000028b, + 0x0000027d,0x00050041,0x0000007a,0x0000028d,0x00000077,0x00000094,0x0004003d,0x00000006, + 0x0000028e,0x0000028d,0x000500b4,0x00000033,0x0000028f,0x0000028e,0x00000090,0x000300f7, + 0x00000293,0x00000000,0x000400fa,0x0000028f,0x00000290,0x00000293,0x000200f8,0x00000290, + 0x00050090,0x0000000f,0x00000292,0x0000040c,0x000000dd,0x000200f9,0x00000293,0x000200f8, + 0x00000293,0x000700f5,0x0000000f,0x0000040f,0x0000040c,0x0000028c,0x00000292,0x00000290, + 0x000200f9,0x00000294,0x000200f8,0x00000294,0x000700f5,0x0000000f,0x0000040e,0x000001eb, + 0x00000267,0x0000040f,0x00000293,0x000200f9,0x00000295,0x000200f8,0x00000295,0x000700f5, + 0x0000000f,0x0000040d,0x00000266,0x00000262,0x0000040e,0x00000294,0x00050051,0x00000006, + 0x000001ee,0x0000040d,0x00000000,0x00060052,0x00000018,0x000003b0,0x000001ee,0x0000040a, + 0x00000000,0x00050051,0x00000006,0x000001f0,0x0000040d,0x00000001,0x00060052,0x00000018, + 0x000003b2,0x000001f0,0x000003b0,0x00000001,0x00050051,0x00000006,0x000001f2,0x0000040d, + 0x00000002,0x00060052,0x00000018,0x000003b4,0x000001f2,0x000003b2,0x00000002,0x000200f9, + 0x000001f3,0x000200f8,0x000001f3,0x000700f5,0x00000018,0x00000415,0x0000040a,0x000001e5, + 0x000003b4,0x00000295,0x00050041,0x0000007a,0x000001f4,0x00000077,0x00000094,0x0004003d, + 0x00000006,0x000001f5,0x000001f4,0x000500b4,0x00000033,0x000001f6,0x000001f5,0x00000084, + 0x000300f7,0x00000234,0x00000000,0x000400fa,0x000001f6,0x000001f7,0x00000204,0x000200f8, + 0x000001f7,0x0008004f,0x0000000f,0x000001f9,0x00000415,0x00000415,0x00000000,0x00000001, + 0x00000002,0x00050041,0x0000007a,0x0000029d,0x00000077,0x00000103,0x0004003d,0x00000006, + 0x0000029e,0x0000029d,0x000500b7,0x00000033,0x0000029f,0x0000029e,0x00000060,0x000300f7, + 0x000002ad,0x00000000,0x000400fa,0x0000029f,0x000002a0,0x000002ad,0x000200f8,0x000002a0, + 0x00050051,0x00000006,0x000002a2,0x00000415,0x00000000,0x000500bc,0x00000033,0x000002b6, + 0x000002a2,0x00000032,0x000300f7,0x000002c0,0x00000000,0x000400fa,0x000002b6,0x000002b7, + 0x000002ba,0x000200f8,0x000002b7,0x00050085,0x00000006,0x000002b9,0x000002a2,0x00000407, + 0x000200f9,0x000002c0,0x000200f8,0x000002ba,0x00050081,0x00000006,0x000002bc,0x000002a2, + 0x0000003c,0x0006000c,0x00000006,0x000002bd,0x00000001,0x00000004,0x000002bc,0x00050085, + 0x00000006,0x000002be,0x000002bd,0x00000406,0x0007000c,0x00000006,0x000002bf,0x00000001, + 0x0000001a,0x000002be,0x00000041,0x000200f9,0x000002c0,0x000200f8,0x000002c0,0x000700f5, + 0x00000006,0x0000042c,0x000002b9,0x000002b7,0x000002bf,0x000002ba,0x00050051,0x00000006, + 0x000002a6,0x00000415,0x00000001,0x000500bc,0x00000033,0x000002c5,0x000002a6,0x00000032, + 0x000300f7,0x000002cf,0x00000000,0x000400fa,0x000002c5,0x000002c6,0x000002c9,0x000200f8, + 0x000002c6,0x00050085,0x00000006,0x000002c8,0x000002a6,0x00000407,0x000200f9,0x000002cf, + 0x000200f8,0x000002c9,0x00050081,0x00000006,0x000002cb,0x000002a6,0x0000003c,0x0006000c, + 0x00000006,0x000002cc,0x00000001,0x00000004,0x000002cb,0x00050085,0x00000006,0x000002cd, + 0x000002cc,0x00000406,0x0007000c,0x00000006,0x000002ce,0x00000001,0x0000001a,0x000002cd, + 0x00000041,0x000200f9,0x000002cf,0x000200f8,0x000002cf,0x000700f5,0x00000006,0x0000042e, + 0x000002c8,0x000002c6,0x000002ce,0x000002c9,0x00050051,0x00000006,0x000002aa,0x00000415, + 0x00000002,0x000500bc,0x00000033,0x000002d4,0x000002aa,0x00000032,0x000300f7,0x000002de, + 0x00000000,0x000400fa,0x000002d4,0x000002d5,0x000002d8,0x000200f8,0x000002d5,0x00050085, + 0x00000006,0x000002d7,0x000002aa,0x00000407,0x000200f9,0x000002de,0x000200f8,0x000002d8, + 0x00050081,0x00000006,0x000002da,0x000002aa,0x0000003c,0x0006000c,0x00000006,0x000002db, + 0x00000001,0x00000004,0x000002da,0x00050085,0x00000006,0x000002dc,0x000002db,0x00000406, + 0x0007000c,0x00000006,0x000002dd,0x00000001,0x0000001a,0x000002dc,0x00000041,0x000200f9, + 0x000002de,0x000200f8,0x000002de,0x000700f5,0x00000006,0x00000430,0x000002d7,0x000002d5, + 0x000002dd,0x000002d8,0x00060050,0x0000000f,0x0000043c,0x0000042c,0x0000042e,0x00000430, + 0x000200f9,0x000002ad,0x000200f8,0x000002ad,0x000700f5,0x0000000f,0x00000432,0x000001f9, + 0x000001f7,0x0000043c,0x000002de,0x00050041,0x0000007a,0x000002af,0x00000077,0x000000f2, + 0x0004003d,0x00000006,0x000002b0,0x000002af,0x0005008e,0x0000000f,0x000002b1,0x00000432, + 0x000002b0,0x00050051,0x00000006,0x000001fc,0x000002b1,0x00000000,0x00050051,0x00000006, + 0x000001fe,0x000002b1,0x00000001,0x00050051,0x00000006,0x00000200,0x000002b1,0x00000002, + 0x00050051,0x00000006,0x00000202,0x00000415,0x00000003,0x00070050,0x00000018,0x00000408, + 0x000001fc,0x000001fe,0x00000200,0x00000202,0x000200f9,0x00000234,0x000200f8,0x00000204, + 0x00050041,0x0000007a,0x00000205,0x00000077,0x00000094,0x0004003d,0x00000006,0x00000206, + 0x00000205,0x000500b4,0x00000033,0x00000207,0x00000206,0x00000090,0x000300f7,0x00000233, + 0x00000000,0x000400fa,0x00000207,0x00000208,0x00000215,0x000200f8,0x00000208,0x0008004f, + 0x0000000f,0x0000020a,0x00000415,0x00000415,0x00000000,0x00000001,0x00000002,0x00050041, + 0x0000007a,0x000002e7,0x00000077,0x000000f2,0x0004003d,0x00000006,0x000002e8,0x000002e7, + 0x0005008e,0x0000000f,0x000002e9,0x0000020a,0x000002e8,0x00050041,0x0000007a,0x000002ea, + 0x00000077,0x00000103,0x0004003d,0x00000006,0x000002eb,0x000002ea,0x000500b7,0x00000033, + 0x000002ec,0x000002eb,0x00000060,0x000400a8,0x00000033,0x000002ed,0x000002ec,0x000300f7, + 0x000002ff,0x00000000,0x000400fa,0x000002ed,0x000002ee,0x000002ff,0x000200f8,0x000002ee, + 0x00050051,0x00000006,0x000002f0,0x000002e9,0x00000000,0x000500bc,0x00000033,0x00000304, + 0x000002f0,0x00000047,0x000300f7,0x0000030e,0x00000000,0x000400fa,0x00000304,0x00000305, + 0x00000308,0x000200f8,0x00000305,0x00050085,0x00000006,0x00000307,0x000002f0,0x00000038, + 0x000200f9,0x0000030e,0x000200f8,0x00000308,0x0006000c,0x00000006,0x0000030a,0x00000001, + 0x00000004,0x000002f0,0x0007000c,0x00000006,0x0000030b,0x00000001,0x0000001a,0x0000030a, + 0x00000050,0x0008000c,0x00000006,0x0000030d,0x00000001,0x00000032,0x0000030b,0x0000003f, + 0x00000409,0x000200f9,0x0000030e,0x000200f8,0x0000030e,0x000700f5,0x00000006,0x00000421, + 0x00000307,0x00000305,0x0000030d,0x00000308,0x00050051,0x00000006,0x000002f4,0x000002e9, + 0x00000001,0x000500bc,0x00000033,0x00000313,0x000002f4,0x00000047,0x000300f7,0x0000031d, + 0x00000000,0x000400fa,0x00000313,0x00000314,0x00000317,0x000200f8,0x00000314,0x00050085, + 0x00000006,0x00000316,0x000002f4,0x00000038,0x000200f9,0x0000031d,0x000200f8,0x00000317, + 0x0006000c,0x00000006,0x00000319,0x00000001,0x00000004,0x000002f4,0x0007000c,0x00000006, + 0x0000031a,0x00000001,0x0000001a,0x00000319,0x00000050,0x0008000c,0x00000006,0x0000031c, + 0x00000001,0x00000032,0x0000031a,0x0000003f,0x00000409,0x000200f9,0x0000031d,0x000200f8, + 0x0000031d,0x000700f5,0x00000006,0x00000423,0x00000316,0x00000314,0x0000031c,0x00000317, + 0x00050051,0x00000006,0x000002f8,0x000002e9,0x00000002,0x000500bc,0x00000033,0x00000322, + 0x000002f8,0x00000047,0x000300f7,0x0000032c,0x00000000,0x000400fa,0x00000322,0x00000323, + 0x00000326,0x000200f8,0x00000323,0x00050085,0x00000006,0x00000325,0x000002f8,0x00000038, + 0x000200f9,0x0000032c,0x000200f8,0x00000326,0x0006000c,0x00000006,0x00000328,0x00000001, + 0x00000004,0x000002f8,0x0007000c,0x00000006,0x00000329,0x00000001,0x0000001a,0x00000328, + 0x00000050,0x0008000c,0x00000006,0x0000032b,0x00000001,0x00000032,0x00000329,0x0000003f, + 0x00000409,0x000200f9,0x0000032c,0x000200f8,0x0000032c,0x000700f5,0x00000006,0x00000425, + 0x00000325,0x00000323,0x0000032b,0x00000326,0x00060050,0x0000000f,0x0000043b,0x00000421, + 0x00000423,0x00000425,0x0008000c,0x0000000f,0x000002fe,0x00000001,0x0000002b,0x0000043b, + 0x00000061,0x00000400,0x000200f9,0x000002ff,0x000200f8,0x000002ff,0x000700f5,0x0000000f, + 0x00000427,0x000002e9,0x00000208,0x000002fe,0x0000032c,0x00050051,0x00000006,0x0000020d, + 0x00000427,0x00000000,0x00050051,0x00000006,0x0000020f,0x00000427,0x00000001,0x00050051, + 0x00000006,0x00000211,0x00000427,0x00000002,0x00050051,0x00000006,0x00000213,0x00000415, + 0x00000003,0x00070050,0x00000018,0x00000405,0x0000020d,0x0000020f,0x00000211,0x00000213, + 0x000200f9,0x00000233,0x000200f8,0x00000215,0x00050041,0x0000007a,0x00000216,0x00000077, + 0x00000094,0x0004003d,0x00000006,0x00000217,0x00000216,0x000500b4,0x00000033,0x00000218, + 0x00000217,0x00000147,0x000300f7,0x00000232,0x00000000,0x000400fa,0x00000218,0x00000219, + 0x0000022f,0x000200f8,0x00000219,0x0008004f,0x0000000f,0x0000021b,0x00000415,0x00000415, + 0x00000000,0x00000001,0x00000002,0x00050090,0x0000000f,0x0000021c,0x0000021b,0x000000dd, + 0x00050051,0x00000006,0x0000021e,0x0000021c,0x00000000,0x00060052,0x00000018,0x000003da, + 0x0000021e,0x0000043d,0x00000000,0x00050051,0x00000006,0x00000220,0x0000021c,0x00000001, + 0x00060052,0x00000018,0x000003dc,0x00000220,0x000003da,0x00000001,0x00050051,0x00000006, + 0x00000222,0x0000021c,0x00000002,0x00060052,0x00000018,0x000003de,0x00000222,0x000003dc, + 0x00000002,0x0008004f,0x0000000f,0x00000224,0x000003de,0x000003de,0x00000000,0x00000001, + 0x00000002,0x00050041,0x0000007a,0x00000335,0x00000077,0x000000f2,0x0004003d,0x00000006, + 0x00000336,0x00000335,0x0005008e,0x0000000f,0x00000337,0x00000224,0x00000336,0x00050041, + 0x0000007a,0x00000338,0x00000077,0x00000103,0x0004003d,0x00000006,0x00000339,0x00000338, + 0x000500b7,0x00000033,0x0000033a,0x00000339,0x00000060,0x000400a8,0x00000033,0x0000033b, + 0x0000033a,0x000300f7,0x0000034d,0x00000000,0x000400fa,0x0000033b,0x0000033c,0x0000034d, + 0x000200f8,0x0000033c,0x00050051,0x00000006,0x0000033e,0x00000337,0x00000000,0x000500bc, + 0x00000033,0x00000352,0x0000033e,0x00000047,0x000300f7,0x0000035c,0x00000000,0x000400fa, + 0x00000352,0x00000353,0x00000356,0x000200f8,0x00000353,0x00050085,0x00000006,0x00000355, + 0x0000033e,0x00000038,0x000200f9,0x0000035c,0x000200f8,0x00000356,0x0006000c,0x00000006, + 0x00000358,0x00000001,0x00000004,0x0000033e,0x0007000c,0x00000006,0x00000359,0x00000001, + 0x0000001a,0x00000358,0x00000050,0x0008000c,0x00000006,0x0000035b,0x00000001,0x00000032, + 0x00000359,0x0000003f,0x00000409,0x000200f9,0x0000035c,0x000200f8,0x0000035c,0x000700f5, + 0x00000006,0x00000416,0x00000355,0x00000353,0x0000035b,0x00000356,0x00050051,0x00000006, + 0x00000342,0x00000337,0x00000001,0x000500bc,0x00000033,0x00000361,0x00000342,0x00000047, + 0x000300f7,0x0000036b,0x00000000,0x000400fa,0x00000361,0x00000362,0x00000365,0x000200f8, + 0x00000362,0x00050085,0x00000006,0x00000364,0x00000342,0x00000038,0x000200f9,0x0000036b, + 0x000200f8,0x00000365,0x0006000c,0x00000006,0x00000367,0x00000001,0x00000004,0x00000342, + 0x0007000c,0x00000006,0x00000368,0x00000001,0x0000001a,0x00000367,0x00000050,0x0008000c, + 0x00000006,0x0000036a,0x00000001,0x00000032,0x00000368,0x0000003f,0x00000409,0x000200f9, + 0x0000036b,0x000200f8,0x0000036b,0x000700f5,0x00000006,0x00000418,0x00000364,0x00000362, + 0x0000036a,0x00000365,0x00050051,0x00000006,0x00000346,0x00000337,0x00000002,0x000500bc, + 0x00000033,0x00000370,0x00000346,0x00000047,0x000300f7,0x0000037a,0x00000000,0x000400fa, + 0x00000370,0x00000371,0x00000374,0x000200f8,0x00000371,0x00050085,0x00000006,0x00000373, + 0x00000346,0x00000038,0x000200f9,0x0000037a,0x000200f8,0x00000374,0x0006000c,0x00000006, + 0x00000376,0x00000001,0x00000004,0x00000346,0x0007000c,0x00000006,0x00000377,0x00000001, + 0x0000001a,0x00000376,0x00000050,0x0008000c,0x00000006,0x00000379,0x00000001,0x00000032, + 0x00000377,0x0000003f,0x00000409,0x000200f9,0x0000037a,0x000200f8,0x0000037a,0x000700f5, + 0x00000006,0x0000041a,0x00000373,0x00000371,0x00000379,0x00000374,0x00060050,0x0000000f, + 0x0000043a,0x00000416,0x00000418,0x0000041a,0x0008000c,0x0000000f,0x0000034c,0x00000001, + 0x0000002b,0x0000043a,0x00000061,0x00000400,0x000200f9,0x0000034d,0x000200f8,0x0000034d, + 0x000700f5,0x0000000f,0x0000041c,0x00000337,0x00000219,0x0000034c,0x0000037a,0x00050051, + 0x00000006,0x00000227,0x0000041c,0x00000000,0x00050051,0x00000006,0x00000229,0x0000041c, + 0x00000001,0x00050051,0x00000006,0x0000022b,0x0000041c,0x00000002,0x00050051,0x00000006, + 0x0000022d,0x00000415,0x00000003,0x00070050,0x00000018,0x00000401,0x00000227,0x00000229, + 0x0000022b,0x0000022d,0x000200f9,0x00000232,0x000200f8,0x0000022f,0x0008004f,0x0000000f, + 0x00000380,0x00000415,0x00000415,0x00000000,0x00000001,0x00000002,0x00050041,0x0000007a, + 0x00000381,0x00000077,0x000000f2,0x0004003d,0x00000006,0x00000382,0x00000381,0x0005008e, + 0x0000000f,0x00000383,0x00000380,0x00000382,0x00050051,0x00000006,0x00000385,0x00000383, + 0x00000000,0x00050051,0x00000006,0x00000387,0x00000383,0x00000001,0x00050051,0x00000006, + 0x00000389,0x00000383,0x00000002,0x00050051,0x00000006,0x0000038b,0x00000415,0x00000003, + 0x00070050,0x00000018,0x000003fc,0x00000385,0x00000387,0x00000389,0x0000038b,0x000200f9, + 0x00000232,0x000200f8,0x00000232,0x000700f5,0x00000018,0x00000439,0x00000401,0x0000034d, + 0x000003fc,0x0000022f,0x000200f9,0x00000233,0x000200f8,0x00000233,0x000700f5,0x00000018, + 0x00000438,0x00000405,0x000002ff,0x00000439,0x00000232,0x000200f9,0x00000234,0x000200f8, + 0x00000234,0x000700f5,0x00000018,0x00000437,0x00000408,0x000002ad,0x00000438,0x00000233, + 0x00050085,0x00000018,0x00000238,0x00000437,0x000001bf,0x0003003e,0x000001c2,0x00000238, + 0x000100fd,0x00010038 }; diff --git a/src/render/vulkan/VULKAN_PixelShader_Colors.h b/src/render/vulkan/VULKAN_PixelShader_Colors.h index fbf1fab6f..3ea22fbc4 100644 --- a/src/render/vulkan/VULKAN_PixelShader_Colors.h +++ b/src/render/vulkan/VULKAN_PixelShader_Colors.h @@ -1,47 +1,47 @@ // 1113.1.1 #pragma once const uint32_t VULKAN_PixelShader_Colors[] = { - 0x07230203,0x00010000,0x0008000b,0x000000a7,0x00000000,0x00020011,0x00000001,0x0006000b, + 0x07230203,0x00010000,0x0008000b,0x000000a1,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, - 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000049,0x0000004d,0x00030010, + 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000048,0x0000004c,0x00030010, 0x00000004,0x00000007,0x00030003,0x00000005,0x000001f4,0x00040005,0x00000004,0x6e69616d, 0x00000000,0x00050005,0x00000018,0x736e6f43,0x746e6174,0x00000073,0x00070006,0x00000018, - 0x00000000,0x47526373,0x756f5f42,0x74757074,0x00000000,0x00070006,0x00000018,0x00000001, - 0x74786574,0x5f657275,0x65707974,0x00000000,0x00060006,0x00000018,0x00000002,0x75706e69, - 0x79745f74,0x00006570,0x00060006,0x00000018,0x00000003,0x6f6c6f63,0x63735f72,0x00656c61, - 0x00070006,0x00000018,0x00000004,0x656e6f74,0x5f70616d,0x6874656d,0x0000646f,0x00070006, - 0x00000018,0x00000005,0x656e6f74,0x5f70616d,0x74636166,0x0031726f,0x00070006,0x00000018, - 0x00000006,0x656e6f74,0x5f70616d,0x74636166,0x0032726f,0x00070006,0x00000018,0x00000007, - 0x5f726473,0x74696877,0x6f705f65,0x00746e69,0x00050006,0x00000018,0x00000008,0x66666f59, - 0x00746573,0x00050006,0x00000018,0x00000009,0x656f6352,0x00006666,0x00050006,0x00000018, - 0x0000000a,0x656f6347,0x00006666,0x00050006,0x00000018,0x0000000b,0x656f6342,0x00006666, - 0x00030005,0x0000001a,0x00000000,0x00050005,0x00000049,0x75706e69,0x6f632e74,0x00726f6c, - 0x00070005,0x0000004d,0x746e6540,0x6f507972,0x4f746e69,0x75707475,0x00000074,0x00050048, - 0x00000018,0x00000000,0x00000023,0x00000000,0x00050048,0x00000018,0x00000001,0x00000023, - 0x00000004,0x00050048,0x00000018,0x00000002,0x00000023,0x00000008,0x00050048,0x00000018, - 0x00000003,0x00000023,0x0000000c,0x00050048,0x00000018,0x00000004,0x00000023,0x00000010, - 0x00050048,0x00000018,0x00000005,0x00000023,0x00000014,0x00050048,0x00000018,0x00000006, - 0x00000023,0x00000018,0x00050048,0x00000018,0x00000007,0x00000023,0x0000001c,0x00050048, - 0x00000018,0x00000008,0x00000023,0x00000020,0x00050048,0x00000018,0x00000009,0x00000023, - 0x00000030,0x00050048,0x00000018,0x0000000a,0x00000023,0x00000040,0x00050048,0x00000018, - 0x0000000b,0x00000023,0x00000050,0x00030047,0x00000018,0x00000002,0x00040047,0x0000001a, - 0x00000022,0x00000000,0x00040047,0x0000001a,0x00000021,0x00000004,0x00040047,0x00000049, - 0x0000001e,0x00000001,0x00040047,0x0000004d,0x0000001e,0x00000000,0x00020013,0x00000002, - 0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007, - 0x00000006,0x00000004,0x00040017,0x00000015,0x00000006,0x00000003,0x000e001e,0x00000018, - 0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006, - 0x00000007,0x00000007,0x00000007,0x00000007,0x00040020,0x00000019,0x00000002,0x00000018, - 0x0004003b,0x00000019,0x0000001a,0x00000002,0x00040015,0x0000001b,0x00000020,0x00000001, - 0x0004002b,0x0000001b,0x0000001c,0x00000003,0x00040020,0x0000001d,0x00000002,0x00000006, - 0x0004002b,0x00000006,0x00000033,0x3f800000,0x00040020,0x0000003f,0x00000001,0x00000007, - 0x0004003b,0x0000003f,0x00000049,0x00000001,0x00040020,0x0000004c,0x00000003,0x00000007, - 0x0004003b,0x0000004c,0x0000004d,0x00000003,0x0006002c,0x00000015,0x000000a5,0x00000033, - 0x00000033,0x00000033,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8, - 0x00000005,0x0004003d,0x00000007,0x0000004a,0x00000049,0x00050041,0x0000001d,0x00000084, - 0x0000001a,0x0000001c,0x0004003d,0x00000006,0x00000085,0x00000084,0x0005008e,0x00000015, - 0x00000086,0x000000a5,0x00000085,0x00050051,0x00000006,0x00000088,0x00000086,0x00000000, - 0x00050051,0x00000006,0x0000008a,0x00000086,0x00000001,0x00050051,0x00000006,0x0000008c, - 0x00000086,0x00000002,0x00070050,0x00000007,0x000000a6,0x00000088,0x0000008a,0x0000008c, - 0x00000033,0x00050085,0x00000007,0x0000007e,0x000000a6,0x0000004a,0x0003003e,0x0000004d, - 0x0000007e,0x000100fd,0x00010038 + 0x00000000,0x47526373,0x756f5f42,0x74757074,0x00000000,0x00060006,0x00000018,0x00000001, + 0x75706e69,0x79745f74,0x00006570,0x00060006,0x00000018,0x00000002,0x6f6c6f63,0x63735f72, + 0x00656c61,0x00060006,0x00000018,0x00000003,0x73756e75,0x705f6465,0x00306461,0x00070006, + 0x00000018,0x00000004,0x656e6f74,0x5f70616d,0x6874656d,0x0000646f,0x00070006,0x00000018, + 0x00000005,0x656e6f74,0x5f70616d,0x74636166,0x0031726f,0x00070006,0x00000018,0x00000006, + 0x656e6f74,0x5f70616d,0x74636166,0x0032726f,0x00070006,0x00000018,0x00000007,0x5f726473, + 0x74696877,0x6f705f65,0x00746e69,0x00050006,0x00000018,0x00000008,0x66666f59,0x00746573, + 0x00050006,0x00000018,0x00000009,0x656f6352,0x00006666,0x00050006,0x00000018,0x0000000a, + 0x656f6347,0x00006666,0x00050006,0x00000018,0x0000000b,0x656f6342,0x00006666,0x00030005, + 0x0000001a,0x00000000,0x00050005,0x00000048,0x75706e69,0x6f632e74,0x00726f6c,0x00070005, + 0x0000004c,0x746e6540,0x6f507972,0x4f746e69,0x75707475,0x00000074,0x00050048,0x00000018, + 0x00000000,0x00000023,0x00000000,0x00050048,0x00000018,0x00000001,0x00000023,0x00000004, + 0x00050048,0x00000018,0x00000002,0x00000023,0x00000008,0x00050048,0x00000018,0x00000003, + 0x00000023,0x0000000c,0x00050048,0x00000018,0x00000004,0x00000023,0x00000010,0x00050048, + 0x00000018,0x00000005,0x00000023,0x00000014,0x00050048,0x00000018,0x00000006,0x00000023, + 0x00000018,0x00050048,0x00000018,0x00000007,0x00000023,0x0000001c,0x00050048,0x00000018, + 0x00000008,0x00000023,0x00000020,0x00050048,0x00000018,0x00000009,0x00000023,0x00000030, + 0x00050048,0x00000018,0x0000000a,0x00000023,0x00000040,0x00050048,0x00000018,0x0000000b, + 0x00000023,0x00000050,0x00030047,0x00000018,0x00000002,0x00040047,0x0000001a,0x00000022, + 0x00000000,0x00040047,0x0000001a,0x00000021,0x00000001,0x00040047,0x00000048,0x0000001e, + 0x00000001,0x00040047,0x0000004c,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021, + 0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006, + 0x00000004,0x00040017,0x00000015,0x00000006,0x00000003,0x000e001e,0x00000018,0x00000006, + 0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000007, + 0x00000007,0x00000007,0x00000007,0x00040020,0x00000019,0x00000002,0x00000018,0x0004003b, + 0x00000019,0x0000001a,0x00000002,0x00040015,0x0000001b,0x00000020,0x00000001,0x0004002b, + 0x0000001b,0x0000001c,0x00000002,0x00040020,0x0000001d,0x00000002,0x00000006,0x0004002b, + 0x00000006,0x00000033,0x3f800000,0x00040020,0x0000003e,0x00000001,0x00000007,0x0004003b, + 0x0000003e,0x00000048,0x00000001,0x00040020,0x0000004b,0x00000003,0x00000007,0x0004003b, + 0x0000004b,0x0000004c,0x00000003,0x0006002c,0x00000015,0x0000009f,0x00000033,0x00000033, + 0x00000033,0x00050036,0x00000002,0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005, + 0x0004003d,0x00000007,0x00000049,0x00000048,0x00050041,0x0000001d,0x0000007e,0x0000001a, + 0x0000001c,0x0004003d,0x00000006,0x0000007f,0x0000007e,0x0005008e,0x00000015,0x00000080, + 0x0000009f,0x0000007f,0x00050051,0x00000006,0x00000082,0x00000080,0x00000000,0x00050051, + 0x00000006,0x00000084,0x00000080,0x00000001,0x00050051,0x00000006,0x00000086,0x00000080, + 0x00000002,0x00070050,0x00000007,0x000000a0,0x00000082,0x00000084,0x00000086,0x00000033, + 0x00050085,0x00000007,0x00000078,0x000000a0,0x00000049,0x0003003e,0x0000004c,0x00000078, + 0x000100fd,0x00010038 }; diff --git a/src/render/vulkan/VULKAN_PixelShader_Common.incl b/src/render/vulkan/VULKAN_PixelShader_Common.incl index 21afb87a2..513bd0334 100644 --- a/src/render/vulkan/VULKAN_PixelShader_Common.incl +++ b/src/render/vulkan/VULKAN_PixelShader_Common.incl @@ -1,8 +1,5 @@ - SamplerState sampler0 : register(s0); -Texture2D texture0 : register(t1); -Texture2D texture1 : register(t2); -Texture2D texture2 : register(t3); +Texture2D texture0 : register(t0); struct PixelShaderInput { @@ -11,28 +8,22 @@ struct PixelShaderInput float4 color : COLOR0; }; -// These should mirror the definitions in SDL_render_d3d12.c +// These should mirror the definitions in SDL_render_vulkan.c static const float TONEMAP_NONE = 0; static const float TONEMAP_LINEAR = 1; static const float TONEMAP_CHROME = 2; -static const float TEXTURETYPE_NONE = 0; -static const float TEXTURETYPE_RGB = 1; -static const float TEXTURETYPE_NV12 = 2; -static const float TEXTURETYPE_NV21 = 3; -static const float TEXTURETYPE_YUV = 4; - static const float INPUTTYPE_UNSPECIFIED = 0; static const float INPUTTYPE_SRGB = 1; static const float INPUTTYPE_SCRGB = 2; static const float INPUTTYPE_HDR10 = 3; -cbuffer Constants : register(b4) +cbuffer Constants : register(b1) { float scRGB_output; - float texture_type; float input_type; float color_scale; + float unused_pad0; float tonemap_method; float tonemap_factor1; @@ -118,48 +109,8 @@ float4 GetInputColor(PixelShaderInput input) { float4 rgba; - if (texture_type == TEXTURETYPE_NONE) { - rgba = 1.0; - } else if (texture_type == TEXTURETYPE_RGB) { - rgba = texture0.Sample(sampler0, input.tex); - } else if (texture_type == TEXTURETYPE_NV12) { - float3 yuv; - yuv.x = texture0.Sample(sampler0, input.tex).r; - yuv.yz = texture1.Sample(sampler0, input.tex).rg; + rgba = texture0.Sample(sampler0, input.tex).rgba; - yuv += Yoffset.xyz; - rgba.r = dot(yuv, Rcoeff.xyz); - rgba.g = dot(yuv, Gcoeff.xyz); - rgba.b = dot(yuv, Bcoeff.xyz); - rgba.a = 1.0; - } else if (texture_type == TEXTURETYPE_NV21) { - float3 yuv; - yuv.x = texture0.Sample(sampler0, input.tex).r; - yuv.yz = texture1.Sample(sampler0, input.tex).gr; - - yuv += Yoffset.xyz; - rgba.r = dot(yuv, Rcoeff.xyz); - rgba.g = dot(yuv, Gcoeff.xyz); - rgba.b = dot(yuv, Bcoeff.xyz); - rgba.a = 1.0; - } else if (texture_type == TEXTURETYPE_YUV) { - float3 yuv; - yuv.x = texture0.Sample(sampler0, input.tex).r; - yuv.y = texture1.Sample(sampler0, input.tex).r; - yuv.z = texture2.Sample(sampler0, input.tex).r; - - yuv += Yoffset.xyz; - rgba.r = dot(yuv, Rcoeff.xyz); - rgba.g = dot(yuv, Gcoeff.xyz); - rgba.b = dot(yuv, Bcoeff.xyz); - rgba.a = 1.0; - } else { - // Error! - rgba.r = 1.0; - rgba.g = 0.0; - rgba.b = 0.0; - rgba.a = 1.0; - } return rgba; } diff --git a/src/render/vulkan/VULKAN_PixelShader_Textures.h b/src/render/vulkan/VULKAN_PixelShader_Textures.h index 33ae15141..afee9ad94 100644 --- a/src/render/vulkan/VULKAN_PixelShader_Textures.h +++ b/src/render/vulkan/VULKAN_PixelShader_Textures.h @@ -1,60 +1,56 @@ // 1113.1.1 #pragma once const uint32_t VULKAN_PixelShader_Textures[] = { - 0x07230203,0x00010000,0x0008000b,0x000000b3,0x00000000,0x00020011,0x00000001,0x0006000b, + 0x07230203,0x00010000,0x0008000b,0x000000a8,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, - 0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000051,0x00000054,0x00000058, + 0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000004b,0x0000004e,0x00000052, 0x00030010,0x00000004,0x00000007,0x00030003,0x00000005,0x000001f4,0x00040005,0x00000004, 0x6e69616d,0x00000000,0x00050005,0x00000018,0x736e6f43,0x746e6174,0x00000073,0x00070006, - 0x00000018,0x00000000,0x47526373,0x756f5f42,0x74757074,0x00000000,0x00070006,0x00000018, - 0x00000001,0x74786574,0x5f657275,0x65707974,0x00000000,0x00060006,0x00000018,0x00000002, - 0x75706e69,0x79745f74,0x00006570,0x00060006,0x00000018,0x00000003,0x6f6c6f63,0x63735f72, - 0x00656c61,0x00070006,0x00000018,0x00000004,0x656e6f74,0x5f70616d,0x6874656d,0x0000646f, - 0x00070006,0x00000018,0x00000005,0x656e6f74,0x5f70616d,0x74636166,0x0031726f,0x00070006, - 0x00000018,0x00000006,0x656e6f74,0x5f70616d,0x74636166,0x0032726f,0x00070006,0x00000018, - 0x00000007,0x5f726473,0x74696877,0x6f705f65,0x00746e69,0x00050006,0x00000018,0x00000008, - 0x66666f59,0x00746573,0x00050006,0x00000018,0x00000009,0x656f6352,0x00006666,0x00050006, - 0x00000018,0x0000000a,0x656f6347,0x00006666,0x00050006,0x00000018,0x0000000b,0x656f6342, - 0x00006666,0x00030005,0x0000001a,0x00000000,0x00050005,0x00000035,0x74786574,0x30657275, - 0x00000000,0x00050005,0x00000039,0x706d6173,0x3072656c,0x00000000,0x00050005,0x00000051, - 0x75706e69,0x65742e74,0x00000078,0x00050005,0x00000054,0x75706e69,0x6f632e74,0x00726f6c, - 0x00070005,0x00000058,0x746e6540,0x6f507972,0x4f746e69,0x75707475,0x00000074,0x00050048, - 0x00000018,0x00000000,0x00000023,0x00000000,0x00050048,0x00000018,0x00000001,0x00000023, - 0x00000004,0x00050048,0x00000018,0x00000002,0x00000023,0x00000008,0x00050048,0x00000018, - 0x00000003,0x00000023,0x0000000c,0x00050048,0x00000018,0x00000004,0x00000023,0x00000010, - 0x00050048,0x00000018,0x00000005,0x00000023,0x00000014,0x00050048,0x00000018,0x00000006, - 0x00000023,0x00000018,0x00050048,0x00000018,0x00000007,0x00000023,0x0000001c,0x00050048, - 0x00000018,0x00000008,0x00000023,0x00000020,0x00050048,0x00000018,0x00000009,0x00000023, - 0x00000030,0x00050048,0x00000018,0x0000000a,0x00000023,0x00000040,0x00050048,0x00000018, - 0x0000000b,0x00000023,0x00000050,0x00030047,0x00000018,0x00000002,0x00040047,0x0000001a, - 0x00000022,0x00000000,0x00040047,0x0000001a,0x00000021,0x00000004,0x00040047,0x00000035, - 0x00000022,0x00000000,0x00040047,0x00000035,0x00000021,0x00000001,0x00040047,0x00000039, - 0x00000022,0x00000000,0x00040047,0x00000039,0x00000021,0x00000000,0x00040047,0x00000051, - 0x0000001e,0x00000000,0x00040047,0x00000054,0x0000001e,0x00000001,0x00040047,0x00000058, - 0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016, - 0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x00040017,0x0000000d, - 0x00000006,0x00000002,0x00040017,0x00000015,0x00000006,0x00000003,0x000e001e,0x00000018, - 0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006, - 0x00000007,0x00000007,0x00000007,0x00000007,0x00040020,0x00000019,0x00000002,0x00000018, - 0x0004003b,0x00000019,0x0000001a,0x00000002,0x00040015,0x0000001b,0x00000020,0x00000001, - 0x0004002b,0x0000001b,0x0000001c,0x00000003,0x00040020,0x0000001d,0x00000002,0x00000006, - 0x00090019,0x00000033,0x00000006,0x00000001,0x00000000,0x00000000,0x00000000,0x00000001, - 0x00000000,0x00040020,0x00000034,0x00000000,0x00000033,0x0004003b,0x00000034,0x00000035, - 0x00000000,0x0002001a,0x00000037,0x00040020,0x00000038,0x00000000,0x00000037,0x0004003b, - 0x00000038,0x00000039,0x00000000,0x0003001b,0x0000003b,0x00000033,0x00040020,0x0000004c, - 0x00000001,0x00000007,0x00040020,0x00000050,0x00000001,0x0000000d,0x0004003b,0x00000050, - 0x00000051,0x00000001,0x0004003b,0x0000004c,0x00000054,0x00000001,0x00040020,0x00000057, - 0x00000003,0x00000007,0x0004003b,0x00000057,0x00000058,0x00000003,0x00050036,0x00000002, - 0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000d,0x00000052, - 0x00000051,0x0004003d,0x00000007,0x00000055,0x00000054,0x0004003d,0x00000033,0x00000081, - 0x00000035,0x0004003d,0x00000037,0x00000082,0x00000039,0x00050056,0x0000003b,0x00000083, - 0x00000081,0x00000082,0x00050057,0x00000007,0x00000086,0x00000083,0x00000052,0x0008004f, - 0x00000015,0x0000008f,0x00000086,0x00000086,0x00000000,0x00000001,0x00000002,0x00050041, - 0x0000001d,0x00000090,0x0000001a,0x0000001c,0x0004003d,0x00000006,0x00000091,0x00000090, - 0x0005008e,0x00000015,0x00000092,0x0000008f,0x00000091,0x00050051,0x00000006,0x00000094, - 0x00000092,0x00000000,0x00050051,0x00000006,0x00000096,0x00000092,0x00000001,0x00050051, - 0x00000006,0x00000098,0x00000092,0x00000002,0x00050051,0x00000006,0x0000009a,0x00000086, - 0x00000003,0x00070050,0x00000007,0x000000b2,0x00000094,0x00000096,0x00000098,0x0000009a, - 0x00050085,0x00000007,0x0000008a,0x000000b2,0x00000055,0x0003003e,0x00000058,0x0000008a, - 0x000100fd,0x00010038 + 0x00000018,0x00000000,0x47526373,0x756f5f42,0x74757074,0x00000000,0x00060006,0x00000018, + 0x00000001,0x75706e69,0x79745f74,0x00006570,0x00060006,0x00000018,0x00000002,0x6f6c6f63, + 0x63735f72,0x00656c61,0x00060006,0x00000018,0x00000003,0x73756e75,0x705f6465,0x00306461, + 0x00070006,0x00000018,0x00000004,0x656e6f74,0x5f70616d,0x6874656d,0x0000646f,0x00070006, + 0x00000018,0x00000005,0x656e6f74,0x5f70616d,0x74636166,0x0031726f,0x00070006,0x00000018, + 0x00000006,0x656e6f74,0x5f70616d,0x74636166,0x0032726f,0x00070006,0x00000018,0x00000007, + 0x5f726473,0x74696877,0x6f705f65,0x00746e69,0x00050006,0x00000018,0x00000008,0x66666f59, + 0x00746573,0x00050006,0x00000018,0x00000009,0x656f6352,0x00006666,0x00050006,0x00000018, + 0x0000000a,0x656f6347,0x00006666,0x00050006,0x00000018,0x0000000b,0x656f6342,0x00006666, + 0x00030005,0x0000001a,0x00000000,0x00050005,0x00000036,0x74786574,0x30657275,0x00000000, + 0x00050005,0x0000004b,0x75706e69,0x65742e74,0x00000078,0x00050005,0x0000004e,0x75706e69, + 0x6f632e74,0x00726f6c,0x00070005,0x00000052,0x746e6540,0x6f507972,0x4f746e69,0x75707475, + 0x00000074,0x00050048,0x00000018,0x00000000,0x00000023,0x00000000,0x00050048,0x00000018, + 0x00000001,0x00000023,0x00000004,0x00050048,0x00000018,0x00000002,0x00000023,0x00000008, + 0x00050048,0x00000018,0x00000003,0x00000023,0x0000000c,0x00050048,0x00000018,0x00000004, + 0x00000023,0x00000010,0x00050048,0x00000018,0x00000005,0x00000023,0x00000014,0x00050048, + 0x00000018,0x00000006,0x00000023,0x00000018,0x00050048,0x00000018,0x00000007,0x00000023, + 0x0000001c,0x00050048,0x00000018,0x00000008,0x00000023,0x00000020,0x00050048,0x00000018, + 0x00000009,0x00000023,0x00000030,0x00050048,0x00000018,0x0000000a,0x00000023,0x00000040, + 0x00050048,0x00000018,0x0000000b,0x00000023,0x00000050,0x00030047,0x00000018,0x00000002, + 0x00040047,0x0000001a,0x00000022,0x00000000,0x00040047,0x0000001a,0x00000021,0x00000001, + 0x00040047,0x00000036,0x00000022,0x00000000,0x00040047,0x00000036,0x00000021,0x00000000, + 0x00040047,0x0000004b,0x0000001e,0x00000000,0x00040047,0x0000004e,0x0000001e,0x00000001, + 0x00040047,0x00000052,0x0000001e,0x00000000,0x00020013,0x00000002,0x00030021,0x00000003, + 0x00000002,0x00030016,0x00000006,0x00000020,0x00040017,0x00000007,0x00000006,0x00000004, + 0x00040017,0x0000000d,0x00000006,0x00000002,0x00040017,0x00000015,0x00000006,0x00000003, + 0x000e001e,0x00000018,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006,0x00000006, + 0x00000006,0x00000006,0x00000007,0x00000007,0x00000007,0x00000007,0x00040020,0x00000019, + 0x00000002,0x00000018,0x0004003b,0x00000019,0x0000001a,0x00000002,0x00040015,0x0000001b, + 0x00000020,0x00000001,0x0004002b,0x0000001b,0x0000001c,0x00000002,0x00040020,0x0000001d, + 0x00000002,0x00000006,0x00090019,0x00000033,0x00000006,0x00000001,0x00000000,0x00000000, + 0x00000000,0x00000001,0x00000000,0x0003001b,0x00000034,0x00000033,0x00040020,0x00000035, + 0x00000000,0x00000034,0x0004003b,0x00000035,0x00000036,0x00000000,0x00040020,0x00000046, + 0x00000001,0x00000007,0x00040020,0x0000004a,0x00000001,0x0000000d,0x0004003b,0x0000004a, + 0x0000004b,0x00000001,0x0004003b,0x00000046,0x0000004e,0x00000001,0x00040020,0x00000051, + 0x00000003,0x00000007,0x0004003b,0x00000051,0x00000052,0x00000003,0x00050036,0x00000002, + 0x00000004,0x00000000,0x00000003,0x000200f8,0x00000005,0x0004003d,0x0000000d,0x0000004c, + 0x0000004b,0x0004003d,0x00000007,0x0000004f,0x0000004e,0x0004003d,0x00000034,0x00000078, + 0x00000036,0x00050057,0x00000007,0x0000007b,0x00000078,0x0000004c,0x0008004f,0x00000015, + 0x00000084,0x0000007b,0x0000007b,0x00000000,0x00000001,0x00000002,0x00050041,0x0000001d, + 0x00000085,0x0000001a,0x0000001c,0x0004003d,0x00000006,0x00000086,0x00000085,0x0005008e, + 0x00000015,0x00000087,0x00000084,0x00000086,0x00050051,0x00000006,0x00000089,0x00000087, + 0x00000000,0x00050051,0x00000006,0x0000008b,0x00000087,0x00000001,0x00050051,0x00000006, + 0x0000008d,0x00000087,0x00000002,0x00050051,0x00000006,0x0000008f,0x0000007b,0x00000003, + 0x00070050,0x00000007,0x000000a7,0x00000089,0x0000008b,0x0000008d,0x0000008f,0x00050085, + 0x00000007,0x0000007f,0x000000a7,0x0000004f,0x0003003e,0x00000052,0x0000007f,0x000100fd, + 0x00010038 }; diff --git a/src/render/vulkan/compile_shaders.bat b/src/render/vulkan/compile_shaders.bat index 446020a7a..de3f91238 100644 --- a/src/render/vulkan/compile_shaders.bat +++ b/src/render/vulkan/compile_shaders.bat @@ -1,5 +1,5 @@ -glslangValidator -D --sep main -e main -S frag --target-env vulkan1.0 --vn VULKAN_PixelShader_Colors -o VULKAN_PixelShader_Colors.h VULKAN_PixelShader_Colors.hlsl -glslangValidator -D --sep main -e main -S frag --target-env vulkan1.0 --vn VULKAN_PixelShader_Textures -o VULKAN_PixelShader_Textures.h VULKAN_PixelShader_Textures.hlsl -glslangValidator -D --sep main -e main -S frag --target-env vulkan1.0 --vn VULKAN_PixelShader_Advanced -o VULKAN_PixelShader_Advanced.h VULKAN_PixelShader_Advanced.hlsl +glslangValidator -D --sep main -e main -S frag --target-env vulkan1.0 --auto-sampled-textures --vn VULKAN_PixelShader_Colors -o VULKAN_PixelShader_Colors.h VULKAN_PixelShader_Colors.hlsl +glslangValidator -D --sep main -e main -S frag --target-env vulkan1.0 --auto-sampled-textures --vn VULKAN_PixelShader_Textures -o VULKAN_PixelShader_Textures.h VULKAN_PixelShader_Textures.hlsl +glslangValidator -D --sep main -e main -S frag --target-env vulkan1.0 --auto-sampled-textures --vn VULKAN_PixelShader_Advanced -o VULKAN_PixelShader_Advanced.h VULKAN_PixelShader_Advanced.hlsl glslangValidator -D --sep mainColor -e main -S vert --iy --target-env vulkan1.0 --vn VULKAN_VertexShader -o VULKAN_VertexShader.h VULKAN_VertexShader.hlsl