From d479af651cb1411020688254e050bba098cb580a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 29 Apr 2014 19:52:10 -0700 Subject: [PATCH] Cleanup. --- src/bgfx_shader.sh | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/bgfx_shader.sh b/src/bgfx_shader.sh index a9bad18d..41e5a24f 100644 --- a/src/bgfx_shader.sh +++ b/src/bgfx_shader.sh @@ -3,8 +3,8 @@ * License: http://www.opensource.org/licenses/BSD-2-Clause */ -#ifndef __BGFX_SHADER_H__ -#define __BGFX_SHADER_H__ +#ifndef BGFX_SHADER_H_HEADER_GUARD +#define BGFX_SHADER_H_HEADER_GUARD #if !defined(BGFX_CONFIG_MAX_BONES) # define BGFX_CONFIG_MAX_BONES 32 @@ -17,6 +17,13 @@ # define dFdy(_y) ddy(-_y) # define inversesqrt(_x) rsqrt(_x) # define fract(_x) frac(_x) +# define vec2_splat(_x) float2(_x, _x) +# define vec3_splat(_x) float3(_x, _x, _x) +# define vec4_splat(_x) float4(_x, _x, _x, _x) + +# define bvec2 bool2 +# define bvec3 bool3 +# define bvec4 bool4 # if BGFX_SHADER_LANGUAGE_HLSL > 3 struct BgfxSampler2D @@ -181,14 +188,6 @@ float bgfxShadow2DProj(sampler2DShadow _sampler, vec4 _coord) # define textureCubeLod(_sampler, _coord, _level) texCUBElod(_sampler, vec4( (_coord).xyz, _level) ) # endif // -# define vec2_splat(_x) float2(_x, _x) -# define vec3_splat(_x) float3(_x, _x, _x) -# define vec4_splat(_x) float4(_x, _x, _x, _x) - -# define bvec2 bool2 -# define bvec3 bool3 -# define bvec4 bool4 - vec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_mtx, _vec); } vec3 instMul(mat3 _mtx, vec3 _vec) { return mul(_vec, _mtx); } vec4 instMul(vec4 _vec, mat4 _mtx) { return mul(_mtx, _vec); } @@ -264,4 +263,4 @@ uniform float u_alphaRef; #endif // __cplusplus -#endif // __BGFX_SHADER_H__ +#endif // BGFX_SHADER_H_HEADER_GUARD