 			#	define EARLY_DEPTH_STENCIL
 			#endif // BGFX_SHADER_LANGUAGE_HLSL > 3 && BGFX_SHADER_TYPE_FRAGMENT
 
-			#if BGFX_SHADER_LANGUAGE_HLSL
+			#if BGFX_SHADER_LANGUAGE_GLSL
+			#   define ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = _type[](
+			#   define ARRAY_END() )
+			#else
+			#   define ARRAY_BEGIN(_type, _name, _count) _type _name[_count] = {
+			#   define ARRAY_END() }
+			#endif // BGFX_SHADER_LANGUAGE_GLSL
+
+			#if BGFX_SHADER_LANGUAGE_HLSL || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV
+			#	define CONST(_x) static const _x
 			#	define dFdx(_x) ddx(_x)
 			#	define dFdy(_y) ddy(-_y)
 			#	define inversesqrt(_x) rsqrt(_x)

			vec4  mod(vec4  _a, vec4  _b) { return _a - _b * floor(_a / _b); }

			#else
			#	define atan2(_x, _y) atan(_x, _y)
			#	define mul(_a, _b) ( (_a) * (_b) )
			#	define saturate(_x) clamp(_x, 0.0, 1.0)
			#	define SAMPLER2D(_name, _reg) uniform sampler2D _name
			#	define SAMPLER3D(_name, _reg) uniform sampler3D _name
			#	define SAMPLERCUBE(_name, _reg) uniform samplerCube _name
			#	define SAMPLER2DSHADOW(_name, _reg) uniform sampler2DShadow _name
			#	define vec2_splat(_x) vec2(_x)
			#	define vec3_splat(_x) vec3(_x)
			#	define vec4_splat(_x) vec4(_x)
			#	define uvec2_splat(_x) uvec2(_x)
			#	define uvec3_splat(_x) uvec3(_x)
			#	define uvec4_splat(_x) uvec4(_x)

			#	if BGFX_SHADER_LANGUAGE_GLSL >= 130
			#		define ISAMPLER3D(_name, _reg) uniform isampler3D _name
			#		define USAMPLER3D(_name, _reg) uniform usampler3D _name
			ivec4 texture3D(isampler3D _sampler, vec3 _coord) { return texture(_sampler, _coord); }
			uvec4 texture3D(usampler3D _sampler, vec3 _coord) { return texture(_sampler, _coord); }
			#	endif // BGFX_SHADER_LANGUAGE_GLSL >= 130

			vec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_vec, _mtx); }

				Texture3D<uvec4> m_texture;
			};

			struct BgfxSamplerCube
			{
				SamplerState m_sampler;
				TextureCube m_texture;
			};

			struct BgfxSampler2DMS
			{
				Texture2DMS<vec4> m_texture;
			};

			vec4 bgfxTexture2D(BgfxSampler2D _sampler, vec2 _coord)
			{
				return _sampler.m_texture.Sample(_sampler.m_sampler, _coord);
			}

			vec4 bgfxTexture2DLod(BgfxSampler2D _sampler, vec2 _coord, float _level)
			{
				return _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level);
			}

			vec4 bgfxTexture2DProj(BgfxSampler2D _sampler, vec3 _coord)
			{
				vec2 coord = _coord.xy * rcp(_coord.z);
				return _sampler.m_texture.Sample(_sampler.m_sampler, coord);
			}

			vec4 bgfxTexture2DProj(BgfxSampler2D _sampler, vec4 _coord)
			{
				vec2 coord = _coord.xy * rcp(_coord.w);
				return _sampler.m_texture.Sample(_sampler.m_sampler, coord);
			}

			vec4 bgfxTexture2DGrad(BgfxSampler2D _sampler, vec2 _coord, vec2 _dPdx, vec2 _dPdy)
			{
				return _sampler.m_texture.SampleGrad(_sampler.m_sampler, _coord, _dPdx, _dPdy);
			}

			vec4 bgfxTexture2DArray(BgfxSampler2DArray _sampler, vec3 _coord)
			{
				return _sampler.m_texture.Sample(_sampler.m_sampler, _coord);
			}

			vec4 bgfxTexture2DArrayLod(BgfxSampler2DArray _sampler, vec3 _coord, float _lod)
			{
				return _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _lod);
			}

			float bgfxShadow2D(BgfxSampler2DShadow _sampler, vec3 _coord)
			{
				return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, _coord.xy, _coord.z);
			}

			float bgfxShadow2DProj(BgfxSampler2DShadow _sampler, vec4 _coord)
			{
				vec3 coord = _coord.xyz * rcp(_coord.w);
				return _sampler.m_texture.SampleCmpLevelZero(_sampler.m_sampler, coord.xy, coord.z);
			}

			vec4 bgfxTexture3D(BgfxSampler3D _sampler, vec3 _coord)
			{
				return _sampler.m_texture.Sample(_sampler.m_sampler, _coord);
			}

			vec4 bgfxTexture3DLod(BgfxSampler3D _sampler, vec3 _coord, float _level)
			{
				return _sampler.m_texture.SampleLevel(_sampler.m_sampler, _coord, _level);
			}

			ivec4 bgfxTexture3D(BgfxISampler3D _sampler, vec3 _coord)
			{
				uvec3 size;
				_sampler.m_texture.GetDimensions(size.x, size.y, size.z);
				return _sampler.m_texture.Load(ivec4(_coord * size, 0) );
			}

			uvec4 bgfxTexture3D(BgfxUSampler3D _sampler, vec3 _coord)
			{
				uvec3 size;
				_sampler.m_texture.GetDimensions(size.x, size.y, size.z);
				return _sampler.m_texture.Load(ivec4(_coord * size, 0) );
			}

			vec4 bgfxTextureCube(BgfxSamplerCube _sampler, vec3 _coord)
			{
				return _sampler.m_texture.Sample(_sampler.m_sampler, _coord);
