Bug 51421 - sin and cos is broken
Summary: sin and cos is broken
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/i915g (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-25 13:00 UTC by Christopher Egert
Modified: 2012-11-27 11:26 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Christopher Egert 2012-06-25 13:00:11 UTC
sin is broken with negative values
it just renders on the right side of the screen in shaders like 
http://glsl.heroku.com/e#2465.1

cos seems to be broken, too, just replace sin with cos on that web page.

mesa: git-d105654
OS: Debian unstable, kernel 3.4
Comment 1 Golubev Yaroslav 2012-11-27 11:26:26 UTC
http://glsl.heroku.com/e#2465.1
>#ifdef GL_ES
>precision mediump float;
>#endif
>uniform float time;
>uniform vec2 mouse;
>uniform vec2 resolution;
>
>void main( void ) {
>	float bla = gl_FragCoord.x/resolution.x; 
>	float value = sin((bla-0.5)*100.0);
>	gl_FragColor = vec4(value,value,value, 1.0 );
>}

1) according to specification sin accepts angle in radians:
2) also gl_FragColor.# should be in [0;1], but sin (x in (0;-pi))<0

=> float value = abs(sin(radians((bla-0.5)*100.0)));
works fine


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.