They are helpful.  I should look at them more closely, and I also need
to go back and look at OGA, but here are some instruction ideas that I
get from what I remember:


First of all, we need registers a register is four floats put together
as a 4x1 vector.  We'll do matrix multiplies as a sequence of dot
products, so a matrix is just four random registers.  For some
purposes, vectors can be looked at as four scalars.  We can make
register zero all 0's like MIPS.  We also need a handful of integer
registers for addresses and counters.  (Although we may just allow the
two datatypes to be stored in the same register file.)

DOT - dot product of two 4x1 vectors
ADD - add corresponding fields of two 4x1 vectors, yielding a 4x1 vector
MUL - multiply coresponding fields of two 4x1 vectors
RECIP - compute reciprocal of all fields in a 4x1 vector
VMOV - move a 4x1 vector from reg to reg
SMOV - move a scalar from any field in one vector to any field in another vector
IMM - load immediate a scalar
IMMI - load immediate an int register
CEQ - compare two vectors, producing a vector; 1's for eq, 0's for neq
CLE - compare two vectors, 1's for <=, 0's for >
CLT - compare two vectors, 1's for <, 0's for >=
BZ - branch on some scalar being zero
BNZ - branch on some scalar being non-zero
BIZ - branch on int register being zero
BINZ - branch on int registers being nonzero
L.w - load scalar float from memory
L.p - load fixed-point 8:8:8:8 vector from memory, convert to vector
L.i - load 32-bit word from memory, store in int register
S.w - store scalar float into memory
S.p - convert vector to fixed and store in memory
S.i - store int register in memory


This needs some work, and it can be generalized a bit, but you get the idea.


On 4/17/06, Lourens Veen <[EMAIL PROTECTED]> wrote:
> On Monday 17 April 2006 17:03, Timothy Miller wrote:
> >
> > Anyhow, it seems to me that we should look at some examples.  There
> > are two things we can do here.  Some people with experience can write
> > out, in high-level pseudo-code, some simple shader programs.  And
> > someone else could look at the OGA "model" and convert that into the
> > pseudo code corresponding to how it would be fully implemented in a
> > programmable shader (some details can be left out).
>
> Perhaps these could be useful?
>
> http://www.lighthouse3d.com/opengl/glsl/index.php?shaders
>
> Lourens
>
>
>
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)

Reply via email to