ARB Fragment Instruction sets

80 views
Skip to first unread message

Peter Chen

unread,
Dec 2, 2012, 6:36:20 PM12/2/12
to uoft_csc...@googlegroups.com
http://www.eecg.toronto.edu/~jzhu/csc467/readings/csc467_finalVersion.pdf

Hi Peter, if you look at slide 27, I don't understand:

    (1) why was ExprTemp3, ExprTemp4 and ExprTemp5 even declared?
    (2) for the IF statement, why was there a SUB instruction at every step? (Shouldn't there be only one since CondTemp1 would've kept the value?
    (3) is the first operator always the destination register?
    (4) does the destination register always have to be declared first?
    (5) does an ARB program always begin with !!ARBfp*? if yes, can we assume its !!ARBfp1.0? Also does it always end with END?
    (6) is it okay to do something like MOV some_register, 1; instead of MOV some_register 1.0? Does the number of zero decimals affect operation? What happens if I put an int literal or int variable into a register?
    (7) do PARAM have to be declared at the top or can be interweaved anywhere in the assembly code?
    (8) what are the bindings of the attribute, uniform and result registers, is this documented somewhere?
                (i) gl_FragColor -> result.color?
                (ii) gl_FragDepth -> result.depth?
                (iii) gl_FragCoord -> fragment.position?
                (iv) gl_TexCoord -> fragment.texcoord[n]? which unit is it?
                (v) gl_Color -> fragment.color?
                (vi) gl_Secondary -> fragment.color.secondary?
                (vii) gl_FogFragCoord ->fragment.fogcoord?
                (viii) gl_Light_Half -> state.light[n].half? again which n?
                (ix) gl_Light_Ambient -> state.light[n].ambient? again which n?
                (x) gl_Material_Shininess -> state.material.shininess?
                (xi) env1 -> program.env[1]?
                (xii) env2 -> program.env[2]?
                (xiii)  env3 -> program.env[3]?

That is all for today.


Peter Goodman

unread,
Dec 5, 2012, 7:15:39 PM12/5/12
to uoft_csc...@googlegroups.com
1) I don't know; it doesn't matter. You're not required to match this output, just produce something that computes the same thing.

2) if you get it working that way then good on you :D

3) Looks to be that way. Obviously consult some ARB fragment documentation. You can use any ARB fragment assembly reference that you want.

4) Yes.

5) Those are good assumptions. Always use the header, I think END is also necessary.

6) Why take the chance? Just do use the right "looking" values for the types; 1.0 float, 1 int, etc. If you're not sure, then it doesn't hurt to try it out with some hand-written ARB fragment assembly.

7) I am not sure; I think they can be declared anywhere before they are used.

8) Oh wow, big oversight on my part:

gl_FragColor -> result.color
gl_FragDepth -> result.depth
gl_FragCoord -> fragment.position
gl_TexCoord -> fragment.texcoord
gl_Color -> fragment.color
gl_color -> fragment.color
gl_Secondary -> fragment.color.secondary
gl_FogFragCoord -> fragment.fogcoord
gl_Light_Half -> state.light[0].half
gl_Light_Ambient -> state.lightmodel.ambient
gl_Material_Shininess -> state.material.shininess
env1 -> program.env[1]
env2 -> program.env[2]
env3 -> program.env[3]

Best Regards,

Peter Goodman,
http://www.petergoodman.me
65 High Park Ave.,
Toronto, Ontario
M6P 2R7




--
 
 

Reply all
Reply to author
Forward
0 new messages