Added sc sampler macros.

This commit is contained in:
bkaradzic 2012-10-27 21:58:58 -07:00
parent caeecc72ce
commit b2f273d934

View file

@ -50,18 +50,21 @@ vec4 bgfxTextureCube(BgfxSamplerCube _sampler, vec3 _coord)
uniform SamplerState _name ## Sampler : register(s[_reg]); \ uniform SamplerState _name ## Sampler : register(s[_reg]); \
uniform Texture2D _name ## Texture : register(t[_reg]); \ uniform Texture2D _name ## Texture : register(t[_reg]); \
static BgfxSampler2D _name = { _name ## Sampler, _name ## Texture } static BgfxSampler2D _name = { _name ## Sampler, _name ## Texture }
# define sampler2D BgfxSampler2D
# define texture2D(_name, _coord) bgfxTexture2D(_name, _coord) # define texture2D(_name, _coord) bgfxTexture2D(_name, _coord)
# define SAMPLER3D(_name, _reg) \ # define SAMPLER3D(_name, _reg) \
uniform SamplerState _name ## Sampler : register(s[_reg]); \ uniform SamplerState _name ## Sampler : register(s[_reg]); \
uniform Texture3D _name ## Texture : register(t[_reg]); \ uniform Texture3D _name ## Texture : register(t[_reg]); \
static BgfxSampler3D _name = { _name ## Sampler, _name ## Texture } static BgfxSampler3D _name = { _name ## Sampler, _name ## Texture }
# define sampler3D BgfxSampler3D
# define texture3D(_name, _coord) bgfxTexture3D(_name, _coord) # define texture3D(_name, _coord) bgfxTexture3D(_name, _coord)
# define SAMPLERCUBE(_name, _reg) \ # define SAMPLERCUBE(_name, _reg) \
uniform SamplerState _name ## Sampler : register(s[_reg]); \ uniform SamplerState _name ## Sampler : register(s[_reg]); \
uniform TextureCube _name ## Texture : register(t[_reg]); \ uniform TextureCube _name ## Texture : register(t[_reg]); \
static BgfxSamplerCube _name = { _name ## Sampler, _name ## Texture } static BgfxSamplerCube _name = { _name ## Sampler, _name ## Texture }
# define samplerCube BgfxSamplerCube
# define textureCube(_name, _coord) bgfxTextureCube(_name, _coord) # define textureCube(_name, _coord) bgfxTextureCube(_name, _coord)
# else # else
# define SAMPLER2D(_name, _reg) uniform sampler2D _name : register(s ## _reg) # define SAMPLER2D(_name, _reg) uniform sampler2D _name : register(s ## _reg)