|
|
|
@@ -31,6 +31,17 @@ |
|
|
|
/* GL_ARB_fragment_program_shadow option flags */ |
|
|
|
.emtcode ARB_FRAGMENT_PROGRAM_SHADOW 0x40 |
|
|
|
|
|
|
|
/* GL_ARB_draw_buffers option flags */ |
|
|
|
.emtcode ARB_DRAW_BUFFERS 0x80 |
|
|
|
|
|
|
|
/* if we need more flags, we have three options: |
|
|
|
1) change the existing flags to indicate an option to a shift, so 0x01 becomes 0 (because |
|
|
|
1 << 0 is 0x01), 0x02 becomes 1 (1 << 1 == 0x02), and so on - this would give us |
|
|
|
256 flags, |
|
|
|
2) mark special value of 0 to say "the following byte will hold the upper 8 bit flags", |
|
|
|
3) expand all the existing flags to be 2 bytes long |
|
|
|
*/ |
|
|
|
|
|
|
|
/* GL_ARB_fragment_program instruction class */ |
|
|
|
.emtcode OP_ALU_INST 0x00 |
|
|
|
.emtcode OP_TEX_INST 0x01 |
|
|
|
@@ -400,6 +411,9 @@ |
|
|
|
/* GL_ARB_fragment_program_shadow */ |
|
|
|
.regbyte fragment_program_shadow 0x00 |
|
|
|
|
|
|
|
/* GL_ARB_draw_buffers */ |
|
|
|
.regbyte draw_buffers 0x00 |
|
|
|
|
|
|
|
/* option presence condition registers */ |
|
|
|
/* they are all initially set to zero - when a particular OPTION is encountered, the appropriate */ |
|
|
|
/* register is set to 1 to indicate that the OPTION was specified. */ |
|
|
|
@@ -417,6 +431,9 @@ |
|
|
|
/* GL_ARB_fragment_program_shadow */ |
|
|
|
.regbyte ARB_fragment_program_shadow 0x00 |
|
|
|
|
|
|
|
/* GL_ARB_draw_buffers */ |
|
|
|
.regbyte ARB_draw_buffers 0x00 |
|
|
|
|
|
|
|
/* program target condition register */ |
|
|
|
/* this syntax script deals with two program targets - VERTEX_PROGRAM and FRAGMENT_PROGRAM. */ |
|
|
|
/* to distinguish between them we need a register that will store for us the current target. */ |
|
|
|
@@ -482,7 +499,9 @@ fp_optionString |
|
|
|
fp_ARB_fog_exp2 .emit ARB_FOG_EXP2 .load ARB_fog_exp2 0x01 .or |
|
|
|
fp_ARB_fog_linear .emit ARB_FOG_LINEAR .load ARB_fog_linear 0x01 .or |
|
|
|
.if (fragment_program_shadow != 0x00) "ARB_fragment_program_shadow" |
|
|
|
.emit ARB_FRAGMENT_PROGRAM_SHADOW .load ARB_fragment_program_shadow 0x01; |
|
|
|
.emit ARB_FRAGMENT_PROGRAM_SHADOW .load ARB_fragment_program_shadow 0x01 .or |
|
|
|
.if (draw_buffers != 0x00) "ARB_draw_buffers" .emit ARB_DRAW_BUFFERS |
|
|
|
.load ARB_draw_buffers 0x01; |
|
|
|
vp_optionString |
|
|
|
"ARB_position_invariant" .emit ARB_POSITION_INVARIANT .load ARB_position_invariant 0x01; |
|
|
|
fp_ARB_fog_exp |
|
|
|
@@ -1952,7 +1971,7 @@ stateClipPlaneNum |
|
|
|
|
|
|
|
/* |
|
|
|
vertex program |
|
|
|
<statePointItem> ::= "point" . <statePointProperty> |
|
|
|
<statePointItem> ::= "point" "." <statePointProperty> |
|
|
|
*/ |
|
|
|
statePointItem |
|
|
|
"point" .and dot .and statePointProperty .error INVALID_POINT_PROPERTY; |
|
|
|
@@ -1992,7 +2011,7 @@ optMatrixRows_1 |
|
|
|
stateMatrixRowNum .and dotdot .and stateMatrixRowNum .and rbracket; |
|
|
|
|
|
|
|
/* |
|
|
|
<stateMatrixItem> ::= "matrix" . <stateMatrixName> |
|
|
|
<stateMatrixItem> ::= "matrix" "." <stateMatrixName> |
|
|
|
<stateOptMatModifier> |
|
|
|
*/ |
|
|
|
stateMatrixItem |
|
|
|
@@ -2063,23 +2082,6 @@ stateOptModMatNum_1 |
|
|
|
stateModMatNum |
|
|
|
integer; |
|
|
|
|
|
|
|
/* |
|
|
|
From ARB_draw_buffers: |
|
|
|
<optOutputColorNum> ::= "" |
|
|
|
| "[" <OutputColorNum> "]" |
|
|
|
*/ |
|
|
|
optOutputColorNum |
|
|
|
optOutputColorNum_1 .or .true .emit 0x00; |
|
|
|
optOutputColorNum_1 |
|
|
|
lbracket_ne .and outputColorNum .and rbracket; |
|
|
|
|
|
|
|
/* |
|
|
|
From ARB_draw_buffers: |
|
|
|
<outputColorNum> ::= <integer> from 0 to MAX_DRAW_BUFFERS_ARB-1 |
|
|
|
*/ |
|
|
|
outputColorNum |
|
|
|
integer; |
|
|
|
|
|
|
|
/* |
|
|
|
<optTexCoordNum> ::= "" |
|
|
|
| "[" <texCoordNum> "]" |
|
|
|
@@ -2322,9 +2324,9 @@ vp_OUTPUT_statement |
|
|
|
vp_resultBinding .error RESULT_EXPECTED; |
|
|
|
|
|
|
|
/* |
|
|
|
From ARB_draw_buffers: |
|
|
|
fragment program |
|
|
|
<resultBinding> ::= "result" "." "color" <optOutputColorNum> |
|
|
|
<resultBinding> ::= "result" "." "color" |
|
|
|
| "result" "." "color" <optOutputColorNum> (if option ARB_draw_buffers present) |
|
|
|
| "result" "." "depth" |
|
|
|
|
|
|
|
vertex program |
|
|
|
@@ -2352,6 +2354,23 @@ vp_resultBinding_1 |
|
|
|
vp_resultBinding_2 |
|
|
|
"texcoord" .and optTexCoordNum; |
|
|
|
|
|
|
|
/* |
|
|
|
GL_ARB_draw_buffers |
|
|
|
<optOutputColorNum> ::= "" |
|
|
|
| "[" <outputColorNum> "]" |
|
|
|
*/ |
|
|
|
optOutputColorNum |
|
|
|
.if (ARB_draw_buffers != 0x00) optOutputColorNum_1 .or .true .emit 0x00; |
|
|
|
optOutputColorNum_1 |
|
|
|
lbracket_ne .and outputColorNum .and rbracket; |
|
|
|
|
|
|
|
/* |
|
|
|
GL_ARB_draw_buffers |
|
|
|
<outputColorNum> ::= <integer> from 0 to MAX_DRAW_BUFFERS_ARB-1 |
|
|
|
*/ |
|
|
|
outputColorNum |
|
|
|
integer; |
|
|
|
|
|
|
|
/* |
|
|
|
vertex program |
|
|
|
<resultColBinding> ::= "color" <optFaceType> <optColorType> |