On Sat, Mar 27, 2010 at 02:11:54AM +0100, Marek Olšák wrote:
> 
> From the driver point of view, we don't have to work on the GLSL compiler
> itself. The Mesa state tracker compiles GLSL to an assembler-like language
> called TGSI which is then translated ([1]) to the R300 compiler ([2]) shader
> representation. The more TGSI we handle, the more GLSL support we get.
> 
> So now the status. r300g GLSL is missing the following features:
> 
> 1) Branching and looping
> 
> This is the most important one and there are 3 things which need to be done.
> * Unrolling loops and converting conditionals to multiplications. This is
> crucial for R3xx-R4xx GLSL support. I don't say it will work in all cases
> but should be fine for the most common ones. This is kind of a standard in
> all proprietary drivers supporting shaders 2.0. It would be nice have it
> work with pure TGSI shaders so that drivers like nvfx can reuse it too and I
> personally prefer to have this feature first before going on.
> * Teaching the R300 compiler loops and conditionals for R500 fragment
> shaders. Note that R500 supports the jump instruction so besides adding new
> opcodes, the compiler optimization passes should be updated too (I think
> they haven't been designed with loops in mind).
> * The same but for R500 vertex shaders. The difference is conditionals must
> be implemented using predication opcodes and predication writes (stuff gets
> masked out). I think this only affects the conversion to machine code at the
> end of the pipeline.
> 
> 2) Derivatives instructions fix
> 
> It's implemented but broken. From docs: "If src0 is computed in the previous
> instruction, then a NOP needs to be inserted between the two instructions.
> Do this by setting the NOP flag in the previous instruction. This is not
> required if the previous instruction is a texture lookup." .. and that
> should be the fix.
> 
> 3) Perspective, flat, and centroid varying modifiers, gl_FrontFacing
> 
> I think this is specific to the rasterizer (RS) block in hw ([3]).
> 
> [1] src/gallium/drivers/r300/r300_tgsi_to_rc.c
> [2] src/mesa/drivers/dri/r300/compiler/
> [3] src/gallium/drivers/r300/r300_state_derived.c
>

Thanks.  This is really helpful.

I am in the process of looking through the code and some of the
documentation.  I'll respond with some questions when I start writing
my proposal.

-Tom

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to