From ce0eea711b936eeffc6f8bf6599f09a252fc2712 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Sun, 27 Dec 2020 23:13:49 -0800 Subject: [PATCH] SetSamplers no longer takes pipeline --- include/Refresh.h | 8 ++------ src/Refresh.c | 4 ---- src/Refresh_Driver.h | 2 -- src/Refresh_Driver_Vulkan.c | 6 ++---- 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/include/Refresh.h b/include/Refresh.h index 62421e7..1cb735f 100644 --- a/include/Refresh.h +++ b/include/Refresh.h @@ -995,15 +995,13 @@ REFRESHAPI void REFRESH_PushFragmentShaderParams( * * NOTE: * The length of the passed arrays must be equal to the number - * of sampler bindings specified by the shader. + * of sampler bindings specified by the pipeline. * - * pipeline: The graphics pipeline to push shader data to. * textures: A pointer to an array of textures. * samplers: A pointer to an array of samplers. */ REFRESHAPI void REFRESH_SetVertexSamplers( REFRESH_Device *device, - REFRESH_GraphicsPipeline *pipeline, REFRESH_Texture **pTextures, REFRESH_Sampler **pSamplers ); @@ -1012,15 +1010,13 @@ REFRESHAPI void REFRESH_SetVertexSamplers( * * NOTE: * The length of the passed arrays must be equal to the number - * of sampler bindings specified by the shader. + * of sampler bindings specified by the pipeline. * - * pipeline: The graphics pipeline to push shader data to. * textures: A pointer to an array of textures. * samplers: A pointer to an array of samplers. */ REFRESHAPI void REFRESH_SetFragmentSamplers( REFRESH_Device *device, - REFRESH_GraphicsPipeline *pipeline, REFRESH_Texture **pTextures, REFRESH_Sampler **pSamplers ); diff --git a/src/Refresh.c b/src/Refresh.c index dca8153..7105b4f 100644 --- a/src/Refresh.c +++ b/src/Refresh.c @@ -554,14 +554,12 @@ void REFRESH_PushFragmentShaderParams( void REFRESH_SetVertexSamplers( REFRESH_Device *device, - REFRESH_GraphicsPipeline *pipeline, REFRESH_Texture **pTextures, REFRESH_Sampler **pSamplers ) { NULL_RETURN(device); device->SetVertexSamplers( device->driverData, - pipeline, pTextures, pSamplers ); @@ -569,14 +567,12 @@ void REFRESH_SetVertexSamplers( void REFRESH_SetFragmentSamplers( REFRESH_Device *device, - REFRESH_GraphicsPipeline *pipeline, REFRESH_Texture **pTextures, REFRESH_Sampler **pSamplers ) { NULL_RETURN(device); device->SetFragmentSamplers( device->driverData, - pipeline, pTextures, pSamplers ); diff --git a/src/Refresh_Driver.h b/src/Refresh_Driver.h index 659befd..d3a3c6d 100644 --- a/src/Refresh_Driver.h +++ b/src/Refresh_Driver.h @@ -368,14 +368,12 @@ struct REFRESH_Device void(*SetVertexSamplers)( REFRESH_Renderer *driverData, - REFRESH_GraphicsPipeline *pipeline, REFRESH_Texture **pTextures, REFRESH_Sampler **pSamplers ); void(*SetFragmentSamplers)( REFRESH_Renderer *driverData, - REFRESH_GraphicsPipeline *pipeline, REFRESH_Texture **pTextures, REFRESH_Sampler **pSamplers ); diff --git a/src/Refresh_Driver_Vulkan.c b/src/Refresh_Driver_Vulkan.c index 5839839..e3c7dbd 100644 --- a/src/Refresh_Driver_Vulkan.c +++ b/src/Refresh_Driver_Vulkan.c @@ -5026,7 +5026,6 @@ static VkDescriptorSet VULKAN_INTERNAL_FetchSamplerDescriptorSet( static void VULKAN_SetVertexSamplers( REFRESH_Renderer *driverData, - REFRESH_GraphicsPipeline *pipeline, REFRESH_Texture **pTextures, REFRESH_Sampler **pSamplers ) { @@ -5034,7 +5033,7 @@ static void VULKAN_SetVertexSamplers( uint32_t i, samplerCount; VulkanRenderer* renderer = (VulkanRenderer*) driverData; - VulkanGraphicsPipeline *graphicsPipeline = (VulkanGraphicsPipeline*) pipeline; + VulkanGraphicsPipeline *graphicsPipeline = renderer->currentGraphicsPipeline; SamplerDescriptorSetData vertexSamplerDescriptorSetData; if (graphicsPipeline->pipelineLayout->vertexSamplerDescriptorSetCache == NULL) @@ -5061,7 +5060,6 @@ static void VULKAN_SetVertexSamplers( static void VULKAN_SetFragmentSamplers( REFRESH_Renderer *driverData, - REFRESH_GraphicsPipeline *pipeline, REFRESH_Texture **pTextures, REFRESH_Sampler **pSamplers ) { @@ -5069,7 +5067,7 @@ static void VULKAN_SetFragmentSamplers( uint32_t i, samplerCount; VulkanRenderer* renderer = (VulkanRenderer*) driverData; - VulkanGraphicsPipeline *graphicsPipeline = (VulkanGraphicsPipeline*) pipeline; + VulkanGraphicsPipeline *graphicsPipeline = renderer->currentGraphicsPipeline; SamplerDescriptorSetData fragmentSamplerDescriptorSetData; if (graphicsPipeline->pipelineLayout->fragmentSamplerDescriptorSetCache == NULL)