Nicolas Boulay wrote:
Someone needs to create "GLSL bytecode". GLSL is the shader language,
comparable to Java source. But there is no OpenGL bytecode equivalent
of Java bytecode, and there should be.
You could find a lot of documentation about cpu on IBM power5 paper, or AMD or
Intel paper. But i have never find the (precise) description of the internal
of a GPU (vertex and pixel shader).
The first generation GPUs all had virtual machine instruction
sets and shaders were written in these "assembler languages."
For OpenGL, the ARB defined two extensions, ARB_vertex_program
and ARB_fragment_program which between them define the registers,
memory addressing, and instruction set of a programmable GPU.
However, those were first generation GPUs without branches or
subroutines. Have a look at extension NV_vertex_program2 (or
possibly 3 or 4 by now) to see what got added.
GLSL bytecode doesn't exist because the OpenGL ARB decided,
after experience with the first generation GPUs, that it's
better to write shaders in a high level language that can be
translated into a vendor-specific implementation. GLSL itself
isn't patented, and 3DLabs released a compiler frontend that
can be freely used by anyone implemented GLSL.
The GPU itself resembles a PPC or other 3 operand RISC
instruction set, but all the registers are SIMD 128 bit/
4 x 32 bit floating point values like Altivec/SSE. (If you
want to do scalar arithmetic, you just select one value
within a 4 way register. Integer ops are done in floating
point and then truncated/rounded.)
From the instruction set and texturing requirements it's
not hard to deduce that there's some special memory
addressing and access hardware for converting 2D texture
coordinates into pixel references as well.
You could IMHO build a quite fast fully programmable GPU
with an Intel P4 or IBM PPC chip with some specialised
frame buffer hardware to do alpha blending/stencil masking/
depth testing on pixel writes.
--
Hugh Fisher
DCS, ANU
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)