Re: [Mesa-dev] glsl2: optimizing unused struct assignments

2010-08-06 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aras Pranckevicius wrote: >> By the way, it would be useful to get some examples of your shaders as >> shader_runner tests in piglit. That makes them easy to analyze for >> optimization opportunities, and they serve as regression tests to make >> sur

Re: [Mesa-dev] glsl2: optimizing unused struct assignments

2010-08-06 Thread Eric Anholt
On Fri, 6 Aug 2010 09:46:17 +0200, Aras Pranckevicius wrote: > > Pushed a change that cleans up the shader you pasted.  Mostly.  There's > > still some junk in it that we could do better at.  Results below. > > Very nice, thanks! > > > > By the way, it would be useful to get some examples of yo

Re: [Mesa-dev] glsl2: optimizing unused struct assignments

2010-08-06 Thread Aras Pranckevicius
> Pushed a change that cleans up the shader you pasted.  Mostly.  There's > still some junk in it that we could do better at.  Results below. Very nice, thanks! > By the way, it would be useful to get some examples of your shaders as > shader_runner tests in piglit.  That makes them easy to anal

Re: [Mesa-dev] glsl2: optimizing unused struct assignments

2010-08-05 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aras Pranckevicius wrote: >> We'll have similar issue with code like: >> uniform vec4 angles; >> void main() { >> vec4 v; >> v.x = sin(angles.x); >> v.y = cos(angles.y); >> v.z = tan(angles.z); >> v.w = 1/tan(angles.w); >> gl_Position = v.

Re: [Mesa-dev] glsl2: optimizing unused struct assignments

2010-08-05 Thread Eric Anholt
On Thu, 5 Aug 2010 13:33:50 +0200, Aras Pranckevicius wrote: > > I believe the plan is to eventually break structures and arrays that are > > not variably indexed into individual variables.  Your structure above > > would be broken into s_used and s_unused.  The existing dead code paths > > would

Re: [Mesa-dev] glsl2: optimizing unused struct assignments

2010-08-05 Thread Aras Pranckevicius
> I believe the plan is to eventually break structures and arrays that are > not variably indexed into individual variables.  Your structure above > would be broken into s_used and s_unused.  The existing dead code paths > would take care of s_unused.  We'll need to do this break-up anyway to > do

Re: [Mesa-dev] glsl2: optimizing unused struct assignments

2010-08-03 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aras Pranckevicius wrote: > Hi, > > Currently GLSL2 optimizer can't remove assignments to struct members > that are never used. After inlining, the struct is often not passed to > any other functions as a whole; and some assignments to the members > m

[Mesa-dev] glsl2: optimizing unused struct assignments

2010-08-03 Thread Aras Pranckevicius
Hi, Currently GLSL2 optimizer can't remove assignments to struct members that are never used. After inlining, the struct is often not passed to any other functions as a whole; and some assignments to the members might be useless. For example, in this fragment shader assignment to s.unused could be