 			vec3  rcp(vec3  _a) { return vec3(1.0)/_a; }
 			vec4  rcp(vec4  _a) { return vec4(1.0)/_a; }
 			#endif // BGFX_SHADER_LANGUAGE_*
+
+			vec2 vec2_splat(float _x) { return vec2(_x, _x); }
+			vec3 vec3_splat(float _x) { return vec3(_x, _x, _x); }
+			vec4 vec4_splat(float _x) { return vec4(_x, _x, _x, _x); }
+
+			#if BGFX_SHADER_LANGUAGE_GLSL >= 130 || BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV
+			uvec2 uvec2_splat(uint _x) { return uvec2(_x, _x); }
+			uvec3 uvec3_splat(uint _x) { return uvec3(_x, _x, _x); }
+			uvec4 uvec4_splat(uint _x) { return uvec4(_x, _x, _x, _x); }
+			#endif // BGFX_SHADER_LANGUAGE_GLSL >= 130 || BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV
 
 			uniform vec4  u_viewRect;
 			uniform vec4  u_viewTexel;

				return _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level);
			}

			#		define SAMPLER2D(_name, _reg) \\
						uniform SamplerState _name ## Sampler : register(s[_reg]); \\
						uniform Texture2D _name ## Texture : register(t[_reg]); \\
						static BgfxSampler2D _name = { _name ## Sampler, _name ## Texture }
			#		define sampler2D BgfxSampler2D
			#		define texture2D(_sampler, _coord) bgfxTexture2D(_sampler, _coord)
			#		define texture2DLod(_sampler, _coord, _level) bgfxTexture2DLod(_sampler, _coord, _level)
			#		define texture2DProj(_sampler, _coord) bgfxTexture2DProj(_sampler, _coord)

			#		define SAMPLER2DSHADOW(_name, _reg) \\
						uniform SamplerComparisonState _name ## Sampler : register(s[_reg]); \\
						uniform Texture2D _name ## Texture : register(t[_reg]); \\
						static BgfxSampler2DShadow _name = { _name ## Sampler, _name ## Texture }
			#		define sampler2DShadow BgfxSampler2DShadow
			#		define shadow2D(_sampler, _coord) bgfxShadow2D(_sampler, _coord)
			#		define shadow2DProj(_sampler, _coord) bgfxShadow2DProj(_sampler, _coord)

			#		define SAMPLER3D(_name, _reg) \\
						uniform SamplerState _name ## Sampler : register(s[_reg]); \\
						uniform Texture3D _name ## Texture : register(t[_reg]); \\
						static BgfxSampler3D _name = { _name ## Sampler, _name ## Texture }
			#		define ISAMPLER3D(_name, _reg) \\
						uniform Texture3D<ivec4> _name ## Texture : register(t[_reg]); \\
						static BgfxISampler3D _name = { _name ## Texture }
			#		define USAMPLER3D(_name, _reg) \\
						uniform Texture3D<uvec4> _name ## Texture : register(t[_reg]); \\
						static BgfxUSampler3D _name = { _name ## Texture }
			#		define sampler3D BgfxSampler3D
			#		define texture3D(_sampler, _coord) bgfxTexture3D(_sampler, _coord)
			#		define texture3DLod(_sampler, _coord, _level) bgfxTexture3DLod(_sampler, _coord, _level)

			#		define SAMPLERCUBE(_name, _reg) \\
						uniform SamplerState _name ## Sampler : register(s[_reg]); \\
						uniform TextureCube _name ## Texture : register(t[_reg]); \\
						static BgfxSamplerCube _name = { _name ## Sampler, _name ## Texture }
			#		define samplerCube BgfxSamplerCube
			#		define textureCube(_sampler, _coord) bgfxTextureCube(_sampler, _coord)
			#		define textureCubeLod(_sampler, _coord, _level) bgfxTextureCubeLod(_sampler, _coord, _level)
			#	else

			#		define sampler2DShadow sampler2D

				Texture2D m_texture;
			};

			struct BgfxSampler3D
			{
				SamplerState m_sampler;
