diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index 292ca1b..0ad6830 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -5022,13 +5022,13 @@ static void VULKAN_SetVertexSamplers( VulkanGraphicsPipeline *graphicsPipeline = (VulkanGraphicsPipeline*) pipeline; SamplerDescriptorSetData vertexSamplerDescriptorSetData; - samplerCount = graphicsPipeline->pipelineLayout->vertexSamplerDescriptorSetCache->samplerBindingCount; - - if (samplerCount == 0) + if (graphicsPipeline->pipelineLayout->vertexSamplerDescriptorSetCache == NULL) { return; } + samplerCount = graphicsPipeline->pipelineLayout->vertexSamplerDescriptorSetCache->samplerBindingCount; + for (i = 0; i < samplerCount; i += 1) { currentTexture = (VulkanTexture*) pTextures[i]; @@ -5057,13 +5057,13 @@ static void VULKAN_SetFragmentSamplers( VulkanGraphicsPipeline *graphicsPipeline = (VulkanGraphicsPipeline*) pipeline; SamplerDescriptorSetData fragmentSamplerDescriptorSetData; - samplerCount = graphicsPipeline->pipelineLayout->fragmentSamplerDescriptorSetCache->samplerBindingCount; - - if (samplerCount == 0) + if (graphicsPipeline->pipelineLayout->vertexSamplerDescriptorSetCache == NULL) { return; } + samplerCount = graphicsPipeline->pipelineLayout->fragmentSamplerDescriptorSetCache->samplerBindingCount; + for (i = 0; i < samplerCount; i += 1) { currentTexture = (VulkanTexture*) pTextures[i];