From 5961876847aeffa98c55d4466e8f9d6329b536ef Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 16 Dec 2020 12:28:45 -0800 Subject: [PATCH] separate sampler layout --- include/Refresh.h | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/include/Refresh.h b/include/Refresh.h index dcd579e..74abe97 100644 --- a/include/Refresh.h +++ b/include/Refresh.h @@ -264,14 +264,6 @@ typedef enum REFRESH_ColorComponentFlagBits typedef uint32_t REFRESH_ColorComponentFlags; -typedef enum REFRESH_ShaderParamType -{ - REFRESH_SHADERPARAMTYPE_SAMPLER, - REFRESH_SHADERPARAMTYPE_SAMPLED_IMAGE, - REFRESH_SHADERPARAMTYPE_COMBINED_IMAGE_SAMPLER, - REFRESH_SHADERPARAMTYPE_UNIFORM -} REFRESH_ShaderParamType; - typedef enum REFRESH_ShaderStage { REFRESH_SHADERSTAGE_VERTEX, @@ -362,10 +354,21 @@ typedef struct REFRESH_RenderTargetBlendState REFRESH_ColorComponentFlags colorWriteMask; } REFRESH_RenderTargetBlendState; +typedef struct REFRESH_ShaderTextureSamplerLayoutBinding +{ + uint32_t binding; + REFRESH_ShaderStage shaderStage; +} REFRESH_ShaderSampleLayoutBinding; + +typedef struct REFRESH_ShaderTextureSamplerLayout +{ + uint32_t bindingCount; + const REFRESH_ShaderSampleLayoutBinding *bindings; +} REFRESH_ShaderTextureSamplerLayout; + typedef struct REFRESH_ShaderParamLayoutBinding { uint32_t binding; - REFRESH_ShaderParamType shaderParamType; REFRESH_ShaderStage shaderStage; } REFRESH_ShaderParamLayoutBinding; @@ -375,6 +378,14 @@ typedef struct REFRESH_ShaderParamLayout const REFRESH_ShaderParamLayoutBinding *bindings; } REFRESH_ShaderParamLayout; +typedef struct REFRESH_PipelineLayoutCreateInfo +{ + uint32_t shaderParamsLayoutCount; + REFRESH_ShaderParamLayout *shaderParamLayouts; + uint32_t shaderTextureSamplerLayoutCount; + const REFRESH_ShaderTextureSamplerLayout *shaderTextureSamplerLayouts; +} REFRESH_PipelineLayoutCreateInfo; + typedef struct REFRESH_RenderTargetDescription { REFRESH_SurfaceFormat format; @@ -391,12 +402,6 @@ typedef struct REFRESH_RenderPassCreateInfo const REFRESH_RenderTargetDescription *renderTargetDescriptions; } REFRESH_RenderPassCreateInfo; -typedef struct REFRESH_PipelineLayoutCreateInfo -{ - uint32_t shaderParamsLayoutCount; - REFRESH_ShaderParamLayout *shaderParamLayouts; -} REFRESH_PipelineLayoutCreateInfo; - /* Pipeline state structures */ typedef struct REFRESH_TopologyState