Here's a quick little list of things that'll need to be addressed in the 
DRI drivers if we want to update them to run shading language programs.

The drivers that currently support GL_ARB_vertex/fragment_program are 
the likely candidates.

1. New instructions

The shading language has conditionals, loops, return statements, etc. 
These can be expressed using the new high-level IF/ELSE/ENDIF, 
BGNLOOP/ENDLOOP, BRK, CONT, etc. opcodes, or simple jumps/branches (see 
prog_instruction.h).  The compiler can emit either kind of code.  In any 
case, support for the new instructions would have to be added in the 
driver code which translates Mesa GPU instructions into hardware 
instructions.

It's not uncommon for shaders to have no branches or loops, resulting in 
simple, straight-line code.  So some shaders could be run on hardware 
that might not support shaders in general.  You'd have to scan the 
program to see what kind of instructions are used.

But we might ask ourselves if we really want to expose the shading 
language in drivers that can't actually run shaders with conditionals, etc.


2. Varying variables

Varying variables are general-purpose values that are transmitted from 
the vertex shader to the fragment shader.  They're like extra sets of 
texture coords that get interpolated during rasterization.  So, drivers 
will need some work to support those.


3. Extra validation

There's new shader-related state that needs to be handled.  One example 
is uniform variables.  Uniforms are shader variables that are constant 
over glBegin/glEnd.  They're stored in Mesa's gl_program_parameter_list
lists just like other constants so it shouldn't be too hard to implement 
them, but it's a new PROGRAM_UNIFORM parameter type.

We may also need to add some new ctx->Driver.foo() hooks for some 
shading language things.  I haven't investigated that enough to say for 
sure though.


I'll try to answer questions about these things if anyone decides to 
tackle this project.

-Brian

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to