Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix log10

  • Loading branch information...
commit e9ce8c7ba65f657bc5f71096ecd15ef94ce9cbd2 1 parent 323023e
@aras-p authored
View
4 Changelog.md
@@ -9,6 +9,10 @@ Goodies:
* uint .. uint4 types can be parsed (they are turned into signed integers in GLSL though).
* SV_InstanceID translates properly to GLES2.0 (EXT_draw_instanced) and GLES3.0.
+Fixes:
+
+* Fixed HLSL log10.
+
2015 01
-------
View
6 hlslang/GLSLCodeGen/hlslSupportLib.cpp
@@ -981,13 +981,13 @@ void initializeHLSLSupportLibrary(ETargetVersion targetVersion)
" return log2 ( x ) / vec4 ( 3.32192809 ); \n"
"}\n\n"
"mat2 xll_log10_mf2x2(mat2 m) {\n"
- " return mat2( xll_log10(m[0]), xll_log10(m[1]));\n"
+ " return mat2( xll_log10_vf2(m[0]), xll_log10_vf2(m[1]));\n"
"}\n\n"
"mat3 xll_log10_mf3x3(mat3 m) {\n"
- " return mat3( xll_log10(m[0]), xll_log10(m[1]), xll_log10(m[2]));\n"
+ " return mat3( xll_log10_vf3(m[0]), xll_log10_vf3(m[1]), xll_log10_vf3(m[2]));\n"
"}\n\n"
"mat4 xll_log10_mf4x4(mat4 m) {\n"
- " return mat4( xll_log10(m[0]), xll_log10(m[1]), xll_log10(m[2]), xll_log10(m[3]));\n"
+ " return mat4( xll_log10_vf4(m[0]), xll_log10_vf4(m[1]), xll_log10_vf4(m[2]), xll_log10_vf4(m[3]));\n"
"}\n\n")
);
View
3  tests/fragment/intrinsics-in.txt
@@ -49,5 +49,8 @@ half4 main (float4 uv : TEXCOORD0, half4 huv : TEXCOORD1) : COLOR0 {
c.xyz += faceforward(uv.xyz, uv.xyw, uv.yzw);
c.xyz += faceforward(huv.xyz, huv.xyw, huv.yzw);
+ c.x += log10(uv.x);
+ c.xyz += log10(uv.xyz);
+
return c;
}
View
23 tests/fragment/intrinsics-out.txt
@@ -18,6 +18,27 @@ vec4 xll_mod_vf4_vf4( vec4 x, vec4 y ) {
vec4 f = fract (abs(d)) * y;
return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w);
}
+float xll_log10_f( float x ) {
+ return log2 ( x ) / 3.32192809;
+}
+vec2 xll_log10_vf2( vec2 x ) {
+ return log2 ( x ) / vec2 ( 3.32192809 );
+}
+vec3 xll_log10_vf3( vec3 x ) {
+ return log2 ( x ) / vec3 ( 3.32192809 );
+}
+vec4 xll_log10_vf4( vec4 x ) {
+ return log2 ( x ) / vec4 ( 3.32192809 );
+}
+mat2 xll_log10_mf2x2(mat2 m) {
+ return mat2( xll_log10_vf2(m[0]), xll_log10_vf2(m[1]));
+}
+mat3 xll_log10_mf3x3(mat3 m) {
+ return mat3( xll_log10_vf3(m[0]), xll_log10_vf3(m[1]), xll_log10_vf3(m[2]));
+}
+mat4 xll_log10_mf4x4(mat4 m) {
+ return mat4( xll_log10_vf4(m[0]), xll_log10_vf4(m[1]), xll_log10_vf4(m[2]), xll_log10_vf4(m[3]));
+}
vec4 xll_lit_f_f_f( float n_dot_l, float n_dot_h, float m ) {
return vec4(1, max(0.0, n_dot_l), pow(max(0.0, n_dot_h) * step(0.0, n_dot_l), m), 1.0);
}
@@ -135,6 +156,8 @@ vec4 xlat_main( in vec4 uv, in vec4 huv ) {
c.xyz += faceforward( uv.xyz, uv.xyw, uv.yzw);
c.xyz += faceforward( huv.xyz, huv.xyw, huv.yzw);
#line 51
+ c.x += xll_log10_f(uv.x);
+ c.xyz += xll_log10_vf3(uv.xyz);
return c;
}
varying vec4 xlv_TEXCOORD0;
View
23 tests/fragment/intrinsics-outES.txt
@@ -18,6 +18,27 @@ vec4 xll_mod_vf4_vf4( vec4 x, vec4 y ) {
vec4 f = fract (abs(d)) * y;
return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w);
}
+float xll_log10_f( float x ) {
+ return log2 ( x ) / 3.32192809;
+}
+vec2 xll_log10_vf2( vec2 x ) {
+ return log2 ( x ) / vec2 ( 3.32192809 );
+}
+vec3 xll_log10_vf3( vec3 x ) {
+ return log2 ( x ) / vec3 ( 3.32192809 );
+}
+vec4 xll_log10_vf4( vec4 x ) {
+ return log2 ( x ) / vec4 ( 3.32192809 );
+}
+mat2 xll_log10_mf2x2(mat2 m) {
+ return mat2( xll_log10_vf2(m[0]), xll_log10_vf2(m[1]));
+}
+mat3 xll_log10_mf3x3(mat3 m) {
+ return mat3( xll_log10_vf3(m[0]), xll_log10_vf3(m[1]), xll_log10_vf3(m[2]));
+}
+mat4 xll_log10_mf4x4(mat4 m) {
+ return mat4( xll_log10_vf4(m[0]), xll_log10_vf4(m[1]), xll_log10_vf4(m[2]), xll_log10_vf4(m[3]));
+}
vec4 xll_lit_f_f_f( float n_dot_l, float n_dot_h, float m ) {
return vec4(1, max(0.0, n_dot_l), pow(max(0.0, n_dot_h) * step(0.0, n_dot_l), m), 1.0);
}
@@ -135,6 +156,8 @@ mediump vec4 xlat_main( in highp vec4 uv, in mediump vec4 huv ) {
c.xyz += faceforward( uv.xyz, uv.xyw, uv.yzw);
c.xyz += faceforward( huv.xyz, huv.xyw, huv.yzw);
#line 51
+ c.x += xll_log10_f(uv.x);
+ c.xyz += xll_log10_vf3(uv.xyz);
return c;
}
varying highp vec4 xlv_TEXCOORD0;
View
23 tests/fragment/intrinsics-outES3.txt
@@ -18,6 +18,27 @@ vec4 xll_mod_vf4_vf4( vec4 x, vec4 y ) {
vec4 f = fract (abs(d)) * y;
return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w);
}
+float xll_log10_f( float x ) {
+ return log2 ( x ) / 3.32192809;
+}
+vec2 xll_log10_vf2( vec2 x ) {
+ return log2 ( x ) / vec2 ( 3.32192809 );
+}
+vec3 xll_log10_vf3( vec3 x ) {
+ return log2 ( x ) / vec3 ( 3.32192809 );
+}
+vec4 xll_log10_vf4( vec4 x ) {
+ return log2 ( x ) / vec4 ( 3.32192809 );
+}
+mat2 xll_log10_mf2x2(mat2 m) {
+ return mat2( xll_log10_vf2(m[0]), xll_log10_vf2(m[1]));
+}
+mat3 xll_log10_mf3x3(mat3 m) {
+ return mat3( xll_log10_vf3(m[0]), xll_log10_vf3(m[1]), xll_log10_vf3(m[2]));
+}
+mat4 xll_log10_mf4x4(mat4 m) {
+ return mat4( xll_log10_vf4(m[0]), xll_log10_vf4(m[1]), xll_log10_vf4(m[2]), xll_log10_vf4(m[3]));
+}
vec4 xll_lit_f_f_f( float n_dot_l, float n_dot_h, float m ) {
return vec4(1, max(0.0, n_dot_l), pow(max(0.0, n_dot_h) * step(0.0, n_dot_l), m), 1.0);
}
@@ -135,6 +156,8 @@ mediump vec4 xlat_main( in highp vec4 uv, in mediump vec4 huv ) {
c.xyz += faceforward( uv.xyz, uv.xyw, uv.yzw);
c.xyz += faceforward( huv.xyz, huv.xyw, huv.yzw);
#line 51
+ c.x += xll_log10_f(uv.x);
+ c.xyz += xll_log10_vf3(uv.xyz);
return c;
}
in highp vec4 xlv_TEXCOORD0;
Please sign in to comment.
Something went wrong with that request. Please try again.