diff --git a/src/bgfx_shader.sh b/src/bgfx_shader.sh index 3a1c669f3..e434c975e 100644 --- a/src/bgfx_shader.sh +++ b/src/bgfx_shader.sh @@ -88,6 +88,40 @@ struct BgfxSampler2D Texture2D m_texture; }; +struct BgfxSampler2DShadow +{ + SamplerComparisonState m_sampler; + Texture2D m_texture; +}; + +struct BgfxSampler3D +{ + SamplerState m_sampler; + Texture3D m_texture; +}; + +struct BgfxISampler3D +{ + Texture3D m_texture; +}; + +struct BgfxUSampler3D +{ + Texture3D m_texture; +}; + +struct BgfxSamplerCube +{ + SamplerState m_sampler; + TextureCube m_texture; +}; + +struct BgfxSampler2DMS +{ + SamplerState m_sampler; + Texture2DMS m_texture; +}; + vec4 bgfxTexture2D(BgfxSampler2D _sampler, vec2 _coord) { return _sampler.m_texture.Sample(_sampler.m_sampler, _coord); @@ -110,18 +144,6 @@ vec4 bgfxTexture2DProj(BgfxSampler2D _sampler, vec4 _coord) return _sampler.m_texture.Sample(_sampler.m_sampler, coord); } -struct BgfxSampler2DMS -{ - SamplerState m_sampler; - Texture2DMS m_texture; -}; - -struct BgfxSampler2DShadow -{ - SamplerComparisonState m_sampler; - Texture2D m_texture; -}; - float bgfxShadow2D(BgfxSampler2DShadow _sampler, vec3 _coord) { return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, _coord.xy, _coord.z); @@ -133,22 +155,6 @@ float bgfxShadow2DProj(BgfxSampler2DShadow _sampler, vec4 _coord) return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, coord.xy, coord.z); } -struct BgfxSampler3D -{ - SamplerState m_sampler; - Texture3D m_texture; -}; - -struct BgfxISampler3D -{ - Texture3D m_texture; -}; - -struct BgfxUSampler3D -{ - Texture3D m_texture; -}; - vec4 bgfxTexture3D(BgfxSampler3D _sampler, vec3 _coord) { return _sampler.m_texture.Sample(_sampler.m_sampler, _coord); @@ -173,12 +179,6 @@ uvec4 bgfxTexture3D(BgfxUSampler3D _sampler, vec3 _coord) return _sampler.m_texture.Load(uvec4(_coord * size, 0) ); } -struct BgfxSamplerCube -{ - SamplerState m_sampler; - TextureCube m_texture; -}; - vec4 bgfxTextureCube(BgfxSamplerCube _sampler, vec3 _coord) { return _sampler.m_texture.Sample(_sampler.m_sampler, _coord);