Re: [Mesa-dev] [PATCH] glsl: lower constant arrays to uniform arrays before optimisation loop

2017-01-17 Thread Timothy Arceri
On Wed, 2017-01-18 at 09:50 +1100, Timothy Arceri wrote: > Previously the last stage would not get optimised until the backend > did > its GLSL IR opt loop. Wait that would be all stages would not get optimised until the backend called the glsl ir opts. Forgot we worked on a stage at a time for a

[Mesa-dev] [PATCH] glsl: lower constant arrays to uniform arrays before optimisation loop

2017-01-17 Thread Timothy Arceri
Previously the last stage would not get optimised until the backend did its GLSL IR opt loop. I plan on removing that from i965 shortly which caused huge regressions in Deus-ex and Tomb Raider which have large constant arrays. Moving lowering before the opt loop in the GLSL linker fixes this and un

Re: [Mesa-dev] [PATCH] glsl: Lower constant arrays to uniform arrays.

2014-10-30 Thread Marek Olšák
I would think that the LLVM backend should be able recognize that it's spilling an array of literals. Marek On Thu, Oct 30, 2014 at 1:43 PM, Marek Olšák wrote: > Hi Tom, > > Could you please elaborate on how we should change the TGSI->LLVM translation? > > Marek > > On Fri, Oct 17, 2014 at 4:49

Re: [Mesa-dev] [PATCH] glsl: Lower constant arrays to uniform arrays.

2014-10-30 Thread Marek Olšák
Hi Tom, Could you please elaborate on how we should change the TGSI->LLVM translation? Marek On Fri, Oct 17, 2014 at 4:49 PM, Tom Stellard wrote: > On Wed, Oct 15, 2014 at 05:32:11PM -0700, Kenneth Graunke wrote: >> Consider GLSL code such as: >> >>const ivec2 offsets[] = >> ivec2[](i

Re: [Mesa-dev] [PATCH] glsl: Lower constant arrays to uniform arrays.

2014-10-24 Thread Tom Stellard
On Wed, Oct 15, 2014 at 05:32:11PM -0700, Kenneth Graunke wrote: > Consider GLSL code such as: > >const ivec2 offsets[] = > ivec2[](ivec2(-1, -1), ivec2(-1, 0), ivec2(-1, 1), > ivec2(0, -1), ivec2(0, 0), ivec2(0, 1), > ivec2(1, -1), ivec2(1, 0), ivec2(1, 1

Re: [Mesa-dev] [PATCH] glsl: Lower constant arrays to uniform arrays.

2014-10-16 Thread Marek Olšák
The radeonsi LLVM backend handles this very poorly too. It seems to do the same thing that i965 does. Marek On Thu, Oct 16, 2014 at 2:32 AM, Kenneth Graunke wrote: > Consider GLSL code such as: > >const ivec2 offsets[] = > ivec2[](ivec2(-1, -1), ivec2(-1, 0), ivec2(-1, 1), >

Re: [Mesa-dev] [PATCH] glsl: Lower constant arrays to uniform arrays.

2014-10-16 Thread Eric Anholt
Kenneth Graunke writes: > Consider GLSL code such as: > >const ivec2 offsets[] = > ivec2[](ivec2(-1, -1), ivec2(-1, 0), ivec2(-1, 1), > ivec2(0, -1), ivec2(0, 0), ivec2(0, 1), > ivec2(1, -1), ivec2(1, 0), ivec2(1, 1)); > >ivec2 offset = offsets[]; > >

Re: [Mesa-dev] [PATCH] glsl: Lower constant arrays to uniform arrays.

2014-10-15 Thread Ian Romanick
I like the idea (when you suggested it in April), but I think this implementation has some issues. I believe making the constant array into a uniform will cause it to be shown by the GL API (e.g., returned by glGetActiveUniform) and counted against uniform limits. Since I doubt we have any piglit

[Mesa-dev] [PATCH] glsl: Lower constant arrays to uniform arrays.

2014-10-15 Thread Kenneth Graunke
Consider GLSL code such as: const ivec2 offsets[] = ivec2[](ivec2(-1, -1), ivec2(-1, 0), ivec2(-1, 1), ivec2(0, -1), ivec2(0, 0), ivec2(0, 1), ivec2(1, -1), ivec2(1, 0), ivec2(1, 1)); ivec2 offset = offsets[]; Both i965 and nv50 currently handle this v