From bb372f1c9bc08e8b0dca983cb4ba36b2f2f039fb Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 16 May 2007 15:34:22 -0700 Subject: Initial implementation of MESA_texture_array Shadow sampling from texture arrays is still not implemented. Everything else should be there, though. --- src/mesa/shader/arbprogram.syn | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/mesa/shader/arbprogram.syn') diff --git a/src/mesa/shader/arbprogram.syn b/src/mesa/shader/arbprogram.syn index 6ab0f269380..4f82717873e 100644 --- a/src/mesa/shader/arbprogram.syn +++ b/src/mesa/shader/arbprogram.syn @@ -36,7 +36,7 @@ compares the value with its REVISION value. If they do not match, the loader is not up to date. */ -.emtcode REVISION 0x09 +.emtcode REVISION 0x0a /* program type */ .emtcode FRAGMENT_PROGRAM 0x01 @@ -64,6 +64,9 @@ /* GL_ARB_draw_buffers option */ .emtcode ARB_DRAW_BUFFERS 0x07 +/* GL_MESA_texture_array option */ +.emtcode MESA_TEXTURE_ARRAY 0x08 + /* GL_ARB_fragment_program instruction class */ .emtcode OP_ALU_INST 0x00 .emtcode OP_TEX_INST 0x01 @@ -223,6 +226,8 @@ .emtcode TEXTARGET_SHADOW1D 0x06 .emtcode TEXTARGET_SHADOW2D 0x07 .emtcode TEXTARGET_SHADOWRECT 0x08 +.emtcode TEXTARGET_1D_ARRAY 0x09 +.emtcode TEXTARGET_2D_ARRAY 0x0a /* face type */ .emtcode FACE_FRONT 0x00 @@ -436,6 +441,9 @@ /* GL_ARB_draw_buffers */ .regbyte draw_buffers 0x00 +/* GL_MESA_texture_array */ +.regbyte texture_array 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. */ @@ -456,6 +464,9 @@ /* GL_ARB_draw_buffers */ .regbyte ARB_draw_buffers 0x00 +/* GL_MESA_texture_array */ +.regbyte MESA_texture_array 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. */ @@ -523,7 +534,9 @@ fp_optionString .if (fragment_program_shadow != 0x00) "ARB_fragment_program_shadow" .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; + .load ARB_draw_buffers 0x01 .or + .if (texture_array != 0x00) "MESA_texture_array" .emit MESA_TEXTURE_ARRAY + .load MESA_texture_array 0x01; vp_optionString "ARB_position_invariant" .emit ARB_POSITION_INVARIANT .load ARB_position_invariant 0x01; fp_ARB_fog_exp @@ -906,7 +919,9 @@ texTarget "3D" .emit TEXTARGET_3D .or .if (texture_rectangle != 0x00) "RECT" .emit TEXTARGET_RECT .or "CUBE" .emit TEXTARGET_CUBE .or - .if (ARB_fragment_program_shadow != 0x00) shadowTarget; + .if (ARB_fragment_program_shadow != 0x00) shadowTarget .or + .if (MESA_texture_array != 0x00) "ARRAY1D" .emit TEXTARGET_1D_ARRAY .or + .if (MESA_texture_array != 0x00) "ARRAY2D" .emit TEXTARGET_2D_ARRAY; /* GL_ARB_fragment_program_shadow -- cgit v1.2.3 From 69358e73ce09b392a94df753b9bf3cb2f6ad97b9 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 5 Jun 2007 09:24:27 -0700 Subject: Updates for array texture shadow targets. --- src/mesa/shader/arbprogparse.c | 14 +++++++++----- src/mesa/shader/arbprogram.syn | 33 ++++++++++++++++++++++++++++----- src/mesa/shader/arbprogram_syn.h | 20 ++++++++++++++++---- 3 files changed, 53 insertions(+), 14 deletions(-) (limited to 'src/mesa/shader/arbprogram.syn') diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 7da3c19a89a..9af3fd0764d 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -374,6 +374,8 @@ LONGSTRING static char arb_grammar_text[] = /* GL_MESA_texture_array */ #define TEXTARGET_1D_ARRAY 0x09 #define TEXTARGET_2D_ARRAY 0x0a +#define TEXTARGET_SHADOW1D_ARRAY 0x0b +#define TEXTARGET_SHADOW2D_ARRAY 0x0c /* face type */ #define FACE_FRONT 0x00 @@ -2991,11 +2993,13 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, case TEXTARGET_CUBE: fp->TexSrcTarget = TEXTURE_CUBE_INDEX; break; - case TEXTARGET_SHADOW1D: - case TEXTARGET_SHADOW2D: - case TEXTARGET_SHADOWRECT: - /* TODO ARB_fragment_program_shadow code */ - break; + case TEXTARGET_SHADOW1D: + case TEXTARGET_SHADOW2D: + case TEXTARGET_SHADOW1D_ARRAY: + case TEXTARGET_SHADOW2D_ARRAY: + case TEXTARGET_SHADOWRECT: + /* TODO ARB_fragment_program_shadow code */ + break; case TEXTARGET_1D_ARRAY: fp->TexSrcTarget = TEXTURE_1D_ARRAY_INDEX; break; diff --git a/src/mesa/shader/arbprogram.syn b/src/mesa/shader/arbprogram.syn index 4f82717873e..1746a876c30 100644 --- a/src/mesa/shader/arbprogram.syn +++ b/src/mesa/shader/arbprogram.syn @@ -21,13 +21,13 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - + /** * \file arbprogram.syn * ARB_fragment/vertex_program syntax * \author Michal Krol */ - + .syntax program; /* @@ -226,8 +226,11 @@ .emtcode TEXTARGET_SHADOW1D 0x06 .emtcode TEXTARGET_SHADOW2D 0x07 .emtcode TEXTARGET_SHADOWRECT 0x08 +/* GL_MESA_texture_array */ .emtcode TEXTARGET_1D_ARRAY 0x09 .emtcode TEXTARGET_2D_ARRAY 0x0a +.emtcode TEXTARGET_SHADOW1D_ARRAY 0x0b +.emtcode TEXTARGET_SHADOW2D_ARRAY 0x0c /* face type */ .emtcode FACE_FRONT 0x00 @@ -912,6 +915,7 @@ fragment program | "CUBE" | "RECT" | (if option ARB_fragment_program_shadow present) + | (if option MESA_texture_array present) */ texTarget "1D" .emit TEXTARGET_1D .or @@ -920,19 +924,38 @@ texTarget .if (texture_rectangle != 0x00) "RECT" .emit TEXTARGET_RECT .or "CUBE" .emit TEXTARGET_CUBE .or .if (ARB_fragment_program_shadow != 0x00) shadowTarget .or - .if (MESA_texture_array != 0x00) "ARRAY1D" .emit TEXTARGET_1D_ARRAY .or - .if (MESA_texture_array != 0x00) "ARRAY2D" .emit TEXTARGET_2D_ARRAY; + .if (MESA_texture_array != 0x00) arrayTarget; /* GL_ARB_fragment_program_shadow ::= "SHADOW1D" | "SHADOW2D" | "SHADOWRECT" + | (if option MESA_texture_array present) */ shadowTarget "SHADOW1D" .emit TEXTARGET_SHADOW1D .or "SHADOW2D" .emit TEXTARGET_SHADOW2D .or - .if (texture_rectangle != 0x00) "SHADOWRECT" .emit TEXTARGET_SHADOWRECT; + .if (texture_rectangle != 0x00) "SHADOWRECT" .emit TEXTARGET_SHADOWRECT .or + .if (MESA_texture_array != 0x00) shadowArrayTarget; + +/* +GL_MESA_texture_array + + ::= "ARRAY1D" + | "ARRAY2D" + + ::= "SHADOWARRAY1D" + | "SHADOWARRAY2D" +*/ + +arrayTarget + "ARRAY1D" .emit TEXTARGET_1D_ARRAY .or + "ARRAY2D" .emit TEXTARGET_2D_ARRAY; + +shadowArrayTarget + "SHADOWARRAY1D" .emit TEXTARGET_SHADOW1D_ARRAY .or + "SHADOWARRAY2D" .emit TEXTARGET_SHADOW2D_ARRAY; /* fragment program diff --git a/src/mesa/shader/arbprogram_syn.h b/src/mesa/shader/arbprogram_syn.h index 30dc9f4594e..5f3f7d6cf46 100644 --- a/src/mesa/shader/arbprogram_syn.h +++ b/src/mesa/shader/arbprogram_syn.h @@ -1,3 +1,7 @@ + +/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ + +" \n" ".syntax program;\n" ".emtcode REVISION 0x0a\n" ".emtcode FRAGMENT_PROGRAM 0x01\n" @@ -122,7 +126,9 @@ ".emtcode TEXTARGET_SHADOW2D 0x07\n" ".emtcode TEXTARGET_SHADOWRECT 0x08\n" ".emtcode TEXTARGET_1D_ARRAY 0x09\n" -".emtcode TEXTARGET_2D_ARRAY 0x0A\n" +".emtcode TEXTARGET_2D_ARRAY 0x0a\n" +".emtcode TEXTARGET_SHADOW1D_ARRAY 0x0b\n" +".emtcode TEXTARGET_SHADOW2D_ARRAY 0x0c\n" ".emtcode FACE_FRONT 0x00\n" ".emtcode FACE_BACK 0x01\n" ".emtcode COLOR_PRIMARY 0x00\n" @@ -479,12 +485,18 @@ " .if (texture_rectangle != 0x00) \"RECT\" .emit TEXTARGET_RECT .or\n" " \"CUBE\" .emit TEXTARGET_CUBE .or\n" " .if (ARB_fragment_program_shadow != 0x00) shadowTarget .or\n" -" .if (MESA_texture_array != 0x00) \"ARRAY1D\" .emit TEXTARGET_1D_ARRAY .or\n" -" .if (MESA_texture_array != 0x00) \"ARRAY2D\" .emit TEXTARGET_2D_ARRAY;\n" +" .if (MESA_texture_array != 0x00) arrayTarget;\n" "shadowTarget\n" " \"SHADOW1D\" .emit TEXTARGET_SHADOW1D .or\n" " \"SHADOW2D\" .emit TEXTARGET_SHADOW2D .or\n" -" .if (texture_rectangle != 0x00) \"SHADOWRECT\" .emit TEXTARGET_SHADOWRECT;\n" +" .if (texture_rectangle != 0x00) \"SHADOWRECT\" .emit TEXTARGET_SHADOWRECT .or\n" +" .if (MESA_texture_array != 0x00) shadowArrayTarget;\n" +"arrayTarget\n" +" \"ARRAY1D\" .emit TEXTARGET_1D_ARRAY .or\n" +" \"ARRAY2D\" .emit TEXTARGET_2D_ARRAY;\n" +"shadowArrayTarget\n" +" \"SHADOWARRAY1D\" .emit TEXTARGET_SHADOW1D_ARRAY .or\n" +" \"SHADOWARRAY2D\" .emit TEXTARGET_SHADOW2D_ARRAY;\n" "optTexImageUnitNum\n" " optTexImageUnitNum_1 .or .true .emit 0x00;\n" "optTexImageUnitNum_1\n" -- cgit v1.2.3