glsl-optimizer icon indicating copy to clipboard operation
glsl-optimizer copied to clipboard

Fragment shader optimimization error

Open matsic opened this issue 10 years ago • 2 comments

During fragment shader optimization it can be incorrent function call inserted such as "vector_insert_TODO".

matsic avatar Oct 22 '13 16:10 matsic

Do you have a shader that reproduces the bug?

aras-p avatar Oct 22 '13 16:10 aras-p

I got the same problem, here is the sample code that cause vector_insert_TODO generated NOTE: change phi[0] to phi.x will fix it.

mediump vec3 computeWeights(mediump float x){ mediump float x2=x_x; mediump float x3=x2_x; mediump vec4 phi; phi[0]=((((-x3)+(3.0_x2))-(3.0_x))+1.0); phi[1]=(((3.0_x3)-(6.0_x2))+4.0); phi[2]=((((float(-3)_x3)+(3.0_x2))+(3.0_x))+1.0); phi[3]=x3; phi=((phi_1.0)/6.0); mediump vec3 w; w[1]=((1.0+x)-((phi[1])/((phi[0])+(phi[1])))); w[0]=((1.0-x)+((phi[3])/((phi[2])+(phi[3])))); w[2]=((phi[2])+(phi[3])); return w; }

march1896 avatar Feb 18 '14 06:02 march1896